After scanning a directory, you can export a snapshot of it. A snapshot is a file that can be opened in Disk Graph later to show the graph as it was at the time of the export.
A snapshot can not only show a directory as it was at a certain point in time, but multiple snapshots exported at different times can also be opened as a file sequence to show the transition over time.
A snapshot file can also be used to display custom hierarchical data inside Disk Graph. To learn how to create a custom snapshot file, please read the following section.
Format
A snapshot is saved as a file with the .fssnapshot
extension, containing any of the following file attributes:
- name
- size
- allocatedSize
- creationDate
- modificationDate
and having one of the following formats.
TSV (tab-separated values)
TSV is the most efficient file format: it has a compact file size resulting in fast read and write speeds.
- The first line indicates the data columns (the file attribute names), separated by tabs.
- The second line indicates the root directory. Its name may be empty, in which case the name of the snapshot file is displayed in Disk Graph.
- All following lines begin with a number of whitespaces equal to the depth of the file inside the root file, followed by the file attributes declared in the first line, separated by tabs. Regular files must indicate all declared attributes, while directories must skip
size
andallocatedSize
, as they are calculated automatically. A required attributed may still be left empty, in which case a default value is used.
Note: Safari may automatically append the .txt
extension. Before opening the file in Disk Graph, you need to manually remove it.
"name" "size" "allocatedSize" "creationDate" "modificationDate"
"" "2018-01-01T00:00:00Z" "2018-01-01T00:00:00Z"
"a" 10 10 "2018-01-01T00:00:00Z" "2018-01-01T00:00:00Z"
"b" "2018-01-01T00:00:00Z" "2018-01-01T00:00:00Z"
"c" 10 10 "2018-01-01T00:00:00Z" "2020-01-01T00:00:00Z"
"d" "2020-01-01T00:00:00Z" "2022-01-01T00:00:00Z"
"e" 10 10 "2022-01-01T00:00:00Z" "2022-01-01T00:00:00Z"
"f" "2022-01-01T00:00:00Z" "2024-01-01T00:00:00Z"
"g" 10 10 "2024-01-01T00:00:00Z" "2024-01-01T00:00:00Z"
"h" 10 10 "2018-01-01T00:00:00Z" "2018-01-01T00:00:00Z"
JSON
JSON is less efficient since the file attribute keys are repeated for every file, but it may be easier to create with programming languages that support it.
- The root is a dictionary with the following keys:
rootFile
: a file object.version
: the version number.
- A file object contains keys for its file attributes.
- Directories contain an additional key
contents
: an array of file objects. Directories may also skip the attributessize
andallocatedSize
, as they are calculated automatically.
- Directories contain an additional key
Note: Safari may automatically append the .txt
extension. Before opening the file in Disk Graph, you need to manually remove it.
{
"rootFile" : {
"contents" : [
{
"contents" : [
{
"contents" : [
{
"allocatedSize" : 10,
"creationDate" : "2022-01-01T00:00:00Z",
"modificationDate" : "2022-01-01T00:00:00Z",
"name" : "e",
"size" : 10
},
{
"contents" : [
{
"allocatedSize" : 10,
"creationDate" : "2024-01-01T00:00:00Z",
"modificationDate" : "2024-01-01T00:00:00Z",
"name" : "g",
"size" : 10
}
],
"creationDate" : "2022-01-01T00:00:00Z",
"modificationDate" : "2024-01-01T00:00:00Z",
"name" : "f"
}
],
"creationDate" : "2020-01-01T00:00:00Z",
"modificationDate" : "2022-01-01T00:00:00Z",
"name" : "d"
},
{
"allocatedSize" : 10,
"creationDate" : "2018-01-01T00:00:00Z",
"modificationDate" : "2020-01-01T00:00:00Z",
"name" : "c",
"size" : 10
}
],
"creationDate" : "2018-01-01T00:00:00Z",
"modificationDate" : "2018-01-01T00:00:00Z",
"name" : "b"
},
{
"allocatedSize" : 10,
"creationDate" : "2018-01-01T00:00:00Z",
"modificationDate" : "2018-01-01T00:00:00Z",
"name" : "a",
"size" : 10
},
{
"allocatedSize" : 10,
"creationDate" : "2018-01-01T00:00:00Z",
"modificationDate" : "2018-01-01T00:00:00Z",
"name" : "h",
"size" : 10
}
],
"creationDate" : "2018-01-01T00:00:00Z",
"modificationDate" : "2018-01-01T00:00:00Z",
"name" : ""
},
"version" : 1
}