copy-metadata
cross-platform lib to copy metadata from one file to another.
- TOCTOU-safe – all metadata changes are applied through open file handles.
- No symlink following – only regular files and directories are supported.
- Cross-platform – uses
fchmod/fchown/futimenson Unix andSetFileInformationByHandle,SetFileTimeon Windows.
Usage
functions:
;
;
;
// copy_metadata = copy_permission + copy_time
or if you don't need to copy timestamps, you can disable the copy-time feature:
[]
= { = "0.3", = false }