FileSystemMap

FileSystemMap[f,root]

gives an association whose keys are the names of files in root, and whose values are the results of applying f to the full names of these files.

FileSystemMap[f,root,n]

gives a nested association in which subdirectories down to level n are represented by an association.

FileSystemMap[f,root,{m,n}]

gives a nested association including files in subdirectories from level m down through n.

FileSystemMap[f,root,lev,r]

combines levels to give a nested output association with r levels.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Apply FileSize to all files contained in a directory:

In[1]:=
Click for copyable input
Out[1]=

Apply FileHash to all files through level 2 of the specified directory:

In[1]:=
Click for copyable input
Out[1]=

Apply FileDate to only those files at level 2 of the specified directory:

In[1]:=
Click for copyable input
Out[1]=

Get a flat association for the same directory:

In[2]:=
Click for copyable input
Out[2]=

Options  (2)

Possible Issues  (1)

See Also

FileSystemScan  FileNames  Map  MaxItems  FileNameForms  ParallelMap  CreateSearchIndex  CreateArchive  ExtractArchive  FileSize  DeleteDirectory

Introduced in 2016
(11.0)