public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin@cygwin.com
Subject: Re: find command seems to lock files
Date: Mon, 19 Aug 2019 18:52:00 -0000	[thread overview]
Message-ID: <fc144ea3-afc0-0671-c174-1f95e3c18bdb@cs.umass.edu> (raw)
In-Reply-To: <CA+7cx1ooYni5-rxMZd8DYWKMkrEz56Ui-+xbPUY+-HJKbRdMDg@mail.gmail.com>

On 8/19/2019 1:21 PM, Morten Kjærulff wrote:
 > I guess that the reason find opens the file (and thereby trigger
 > antivirus) is because I print the files timestamp (-printf '%A+\n'),
 > right?
 > If I just printed the filename, the file would not be opened, right?
I wouldn't say it _opens_ the file, but I read through the Posix man
page for stat/lstat/fstatat and it reveals that those calls update
the last access time in the inode, so that access the file "more"
than just getting some information from the directory.

 > Will
 > find /xx -type f -iname "zzz" -mtime +10s -execdir 'msg * "Achtung
 > programme crash boom!"'
 > not open the file to get the timestamp?

It still needs to look at the timestamps, and presumably
needs stat to do that.  All you can get from the directory
proper is the inode number and the name, I believe.  That is
not even enough for find to know whether it has to recurse
into the thing (is it a directory or not?), so I suspect
that find always does a stat call on every entry.

Regards - EM

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2019-08-19 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 12:49 Morten Kjærulff
2019-08-19 14:06 ` Corinna Vinschen
2019-08-19 14:13   ` Eliot Moss
2019-08-19 14:26     ` Corinna Vinschen
2019-08-19 14:41       ` Morten Kjærulff
2019-08-19 15:03         ` Eliot Moss
2019-08-19 17:05         ` Andrey Repin
2019-08-19 17:21           ` Andrey Repin
2019-08-19 17:41           ` Morten Kjærulff
2019-08-19 18:52             ` Eliot Moss [this message]
2019-08-19 19:43           ` Greywolf
2019-08-21 19:53           ` L A Walsh
2019-08-26  1:57 ` Chris Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc144ea3-afc0-0671-c174-1f95e3c18bdb@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).