Skip to content

Commit

Permalink
docs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nfischer committed Jan 26, 2022
1 parent df4cdaf commit 3c57b61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Available options:
+ `-r`, `-R`: recursive
+ `-L`: follow symlinks
+ `-P`: don't follow symlinks
+ `-p`: preserve file mode, ownership, and timestamps

Examples:

Expand Down
3 changes: 3 additions & 0 deletions src/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function copyFileSync(srcFile, destFile, options) {

if (options.preserve) {
fs.fchownSync(fdw, srcStat.uid, srcStat.gid);
// Note: utimesSync does not work (rounds to seconds), but futimesSync has
// millisecond precision.
fs.futimesSync(fdw, srcStat.atime, srcStat.mtime);
}

Expand Down Expand Up @@ -201,6 +203,7 @@ function cpcheckcycle(sourceDir, srcFile) {
//@ + `-r`, `-R`: recursive
//@ + `-L`: follow symlinks
//@ + `-P`: don't follow symlinks
//@ + `-p`: preserve file mode, ownership, and timestamps
//@
//@ Examples:
//@
Expand Down

0 comments on commit 3c57b61

Please sign in to comment.