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

 
 

bug #51069: find changes access time on directories

Submitted by:  None
Submitted on:  Fri 19 May 2017 03:44:12 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Working as Intended
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: AdeshOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.6.0
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 May 2017 12:35:55 PM UTCjayStatusNone=>Working as Intended
      Open/ClosedOpen=>Closed
    Sat 20 May 2017 12:32:16 PM UTCjayAssigned toNone=>jay

    Back to the top


    Powered by Savane 3.1-cleanup1