preserve mtime when copying files (#1026)

* make it possible to preserve mtime and atime when copying files

Preserving other attributes like ownership, ctime or btime of a file is
desired but currently not possible to implement in a portable way with go.

Fixes #869
Relates to #779

* FIXUP use cp-compatible default for not-preserving mode
This commit is contained in:
raslop authored and GitHub committed 2023-05-21 19:41:01 +03:00
1 parent 24bba6288d
commit fdb320d30c
7 files changed
+76 -13

No files matched your search

+2
View File
@@ -76,6 +76,7 @@ var gOpts struct {
history bool
info []string
ruler []string
preserve []string
shellopts []string
keys map[string]expr
cmdkeys map[string]expr
@@ -136,6 +137,7 @@ func init() {
gOpts.history = true
gOpts.info = nil
gOpts.ruler = []string{"acc", "progress", "selection", "filter", "ind"}
gOpts.preserve= []string{"mode"}
gOpts.shellopts = nil
gOpts.sortType = sortType{naturalSort, dirfirstSort}
gOpts.tempmarks = "'"