Wolfram Language

Systems-Level Functionality

Analyze and Modify Nested Directories

Get an association of the FileByteCount for each file in the $InstallationDirectory.

In[1]:=
Click for copyable input
FileSystemMap[FileByteCount, $InstallationDirectory]
Out[1]=

Get a nested association of FileDate values for all files within the first two levels of a directory.

In[2]:=
Click for copyable input
FileSystemMap[FileDate, FileNameJoin[{$InstallationDirectory, "Documentation", "English"}], 2]
Out[2]=

Get the same results, but as a flat association.

In[3]:=
Click for copyable input
FileSystemMap[FileDate, FileNameJoin[{$InstallationDirectory, "Documentation", "English"}], 2, 1]
Out[3]=

Check the modification date for files in $UserBaseDirectory.

In[4]:=
Click for copyable input
FileSystemMap[FileDate, $UserBaseDirectory, 2]
Out[4]=

Set the FileDate for all files through level 2 of the specified directory.

In[5]:=
Click for copyable input
FileSystemScan[SetFileDate, $UserBaseDirectory, 2]

All files in $UserBaseDirectory now have the same modification date.

In[6]:=
Click for copyable input
FileSystemMap[FileDate, $UserBaseDirectory, 2, 1]
Out[6]=

Related Examples

de es fr ja ko pt-br ru zh