bugfindutils - Bugs: bug #51069, find changes access time on...

 
 

bug #51069: find changes access time on directories

Submitter:  None
Submitted:  Fri 19 May 2017 03:44:12 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Working as Intended
Privacy:  Public Assigned to:  jay
Originator Name:  Adesh Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.6.0
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 May 2017 03:17:01 PM UTC, comment #2: 

Linux has an extension open(O_NOATIME) that allows one to pick-and-choose when to NOT adjust the atime of a directory, without being as heavy-handed as a mount option for all operations on the entire tree.  As an extension to POSIX, we could offer an option to find to turn on noatime mode.  But it would first need support in gnulib's fts code.  Several other GNU utilities (like coreutils' du and friends) could also benefit from exposing such an option, on operating systems where it is feasible.

Eric Blake <ericb>
Group administrator
Sat 20 May 2017 12:32:16 PM UTC, comment #1: 

The access time of the directory is being updated by the kernel when find reads the directory to search it.  POSIX requires this.

If find offered an extension which saved and restored the st_atime in directories, then the step of restoring the st_actime timestamp would (unavoidably, I believe, because of the way utimes is specified) update the st_ctime timestamp.   That is, if anything, worse.

If you want access times not to be updated, your best bet is to mount the file system read-only, or (if the kernel is Linux) to use the noatime mount option.

James Youngman <jay>
Group administrator
Fri 19 May 2017 03:44:12 PM UTC, original submission:  

Command line:
$ find . -xdev -mmin -5

Running the above command modifies the access time of all subdirectories under current directory to current timestamp.
This looks like a bug to me since I do not expect 'find' to modify filesystem as it is a utility to, you know, find files.

If this is not a bug please explain this behaviour, may be put an explanation on the site or manual page.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-20 jay StatusNone Working as Intended
        Open/ClosedOpen Closed
    2017-05-20 jay Assigned toNone jay

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code