Hi,

bytevolc...@safe-mail.net wrote on Fri, Apr 07, 2017 at 12:25:10PM +1000:

> Although mv(1) will preserve atime and mtime for moved directories if
> moved to a different file system, it doesn't preserve them when moved
> in the same file system.

Cannot reproduce.

   $ mkdir Foo
   $ touch -t 200001010000 Foo 
   $ ls -dl Foo                
  drwxr-xr-x  2 schwarze  schwarze  512 Jan  1  2000 Foo
   $ ls -dlu Foo
  drwxr-xr-x  2 schwarze  schwarze  512 Jan  1  2000 Foo
   $ mv Foo Bar
   $ ls -dl Bar  
  drwxr-xr-x  2 schwarze  schwarze  512 Jan  1  2000 Bar
   $ ls -dlu Bar
  drwxr-xr-x  2 schwarze  schwarze  512 Jan  1  2000 Bar

> This patch adds a "-p" flag as an extension to allow preserving the
> time stamps, whilst allowing mv(1) to retain POSIX behaviour without
> the flag.

Sounds like a bad idea.  Do not add non-standard options to standard
utilities unless they are useful to a very unusual degree.  Even if
there is some corner case that you failed to describe, this seems
by far not important enough for adding an option.

Besides, neither FreeBSD nor NetBSD have -p, so it would be an
egregious example of introducing gratuitious incompatibility.

Yours,
  Ingo

Reply via email to