mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 17:11:37 +02:00
local: when using -l
fix setting modification times of symlinks #1152
Before this change it was setting the modification times of the things that the symlinks pointed to. Note that this is only implemented for unix style OSes. Other OSes will not attempt to set the modification time of a symlink.
This commit is contained in:
@ -744,7 +744,12 @@ func (o *Object) ModTime() time.Time {
|
||||
|
||||
// SetModTime sets the modification time of the local fs object
|
||||
func (o *Object) SetModTime(modTime time.Time) error {
|
||||
err := os.Chtimes(o.path, modTime, modTime)
|
||||
var err error
|
||||
if o.translatedLink {
|
||||
err = lChtimes(o.path, modTime, modTime)
|
||||
} else {
|
||||
err = os.Chtimes(o.path, modTime, modTime)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user