[toggle ads]

Odi's astoundingly incomplete notes

New entries | Code

findutils atime, mtime, ctime have "interesting" semantics

How not to design a user interface:
       -atime n
              File  was  last accessed n*24 hours ago.  When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.

Even tough you say -atime +1, it actually behaves like "atime + 2 days >= now". It's not intuitive. It encourages people of shooting themselves in the foot.

posted on 2016-06-13 15:17 CEST in Code | 0 comments | permalink