Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compare the contents of two directories
ResourceFunction["FileSystemCompare"][path1,path2] compares the contents of two folders in the local file system. |
| "FilePattern" | "*" | include files whose names match the given string pattern |
| "Depth" | Infinity | include files that are in subdirectories up to the given depth |
| "ComparisonMethod" | "Name" | the file property used to compare files |
| "AbsoluteFileName" | the full path to the file, resolving symbolic links as needed |
| "ByteCount" | the size of the file on disk in bytes |
| "CreationDate" | when the file was originally created |
| "DirectoryName" | the DirectoryName of the file |
| "FileAssociation" | the path to the default application used to open the file |
| "FileAttributes" | file system attributes for the file |
| "FileBaseName" | the FileBaseName of the file |
| "FileExtension" | the FileExtension of the file |
| "FileType" | the FileType of the file |
| "LastAccessDate" | when the file was last accessed |
| "LastChangeDate" | when the file's attributes were last changed |
| "LastModificationDate" | when the file was last modified |
| "OwnerName" | the user name of the file's owner |
| "Permissions" | the permissions of the file |
| "ReadOnly" | whether or not the file is marked as read only |
Create two example directories with identical contents:
| In[1]:= | ![]() |
A comparison shows no changes:
| In[2]:= |
| Out[2]= |
Show changes with a file deleted from the second directory:
| In[3]:= |
| Out[4]= |
Show changes with a file added to the second directory:
| In[5]:= | ![]() |
| Out[6]= |
By default, FileSystemCompare will look at all files:
| In[7]:= |
| Out[7]= |
Specify a pattern to match file names:
| In[8]:= |
| Out[8]= |
By default, FileSystemCompare recursively searches subdirectories:
| In[9]:= | ![]() |
| Out[10]= |
Specify a level to limit the depth of the search:
| In[11]:= |
| Out[11]= |
By default, only file names are used:
| In[12]:= |
| Out[8]= |
Use FileHash to test if the contents of files are different:
| In[13]:= |
| Out[13]= |
Use a file property to compare files:
| In[14]:= |
| Out[14]= |
| In[15]:= |
| Out[15]= |
Find how many new documentation notebooks were added and removed in Mathematica 12.0 (this only works if you have 11.3 installed as well):
| In[16]:= |
| Out[16]= |
| In[17]:= |
| Out[17]= |
| In[18]:= | ![]() |
| Out[18]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License