Analyze and Modify Nested Directories
Get an association of the FileByteCount for each file in the $InstallationDirectory.
In[1]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_45.png)
FileSystemMap[FileByteCount, $InstallationDirectory]
Out[1]=
![](assets.en/analyze-and-modify-nested-directories/O_38.png)
Get a nested association of FileDate values for all files within the first two levels of a directory.
In[2]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_46.png)
FileSystemMap[FileDate,
FileNameJoin[{$InstallationDirectory, "Documentation", "English"}],
2]
Out[2]=
![](assets.en/analyze-and-modify-nested-directories/O_39.png)
Get the same results, but as a flat association.
In[3]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_47.png)
FileSystemMap[FileDate,
FileNameJoin[{$InstallationDirectory, "Documentation",
"English"}], 2, 1]
Out[3]=
![](assets.en/analyze-and-modify-nested-directories/O_40.png)
Check the modification date for files in $UserBaseDirectory.
In[4]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_48.png)
FileSystemMap[FileDate, $UserBaseDirectory, 2]
Out[4]=
![](assets.en/analyze-and-modify-nested-directories/O_41.png)
Set the FileDate for all files through level 2 of the specified directory.
In[5]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_49.png)
FileSystemScan[SetFileDate, $UserBaseDirectory, 2]
All files in $UserBaseDirectory now have the same modification date.
In[6]:=
![Click for copyable input](assets.en/analyze-and-modify-nested-directories/In_50.png)
FileSystemMap[FileDate, $UserBaseDirectory, 2, 1]
Out[6]=
![](assets.en/analyze-and-modify-nested-directories/O_42.png)