#target-directory #file #modified #subdirectories #changed #modification #timestamp

bin+lib diffcopy

Copy modified files from sub directories into one target directory

2 releases

0.1.1 Feb 27, 2024
0.1.0 Feb 19, 2024

#538 in Filesystem

36 downloads per month

MIT/Apache

9KB
155 lines

diffcopy

Copy modified files from sub directories into one target directory.

diffcopy checks which files have changed in a directory including its subdirectories based on the file name, file size and modification date.

These files are then copied to a target directory while retaining the original modification date.

If a file with the same name is stored in two or more directories, the file with the highest modification timestamp is copied.

./diffcopy test_data/input /test_data/output txt,dxf

test_data
├── input
│   ├── 2022
│   │   └── foo.txt
│   └── 2023
│       ├── another
│       │   └── baz.txt
│       └── bar.txt
└── output
    ├── bar.txt
    ├── baz.txt
    └── foo.txt

Dependencies

~1–9MB
~58K SLoC