From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112143 invoked by alias); 19 Aug 2019 17:41:57 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 112131 invoked by uid 89); 19 Aug 2019 17:41:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Aug 2019 17:41:56 +0000 Received: from [192.168.0.8] (cpe-108-183-164-222.maine.res.rr.com [108.183.164.222]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id BBF694023B97; Mon, 19 Aug 2019 13:41:54 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: find command seems to lock files To: cygwin@cygwin.com References: <20190819140308.GN11632@calimero.vinschen.de> <609c28ca-07da-f150-139b-267448ede826@cs.umass.edu> <20190819141321.GO11632@calimero.vinschen.de> <1621839017.20190819194256@yandex.ru> From: Eliot Moss Message-ID: Date: Mon, 19 Aug 2019 18:52:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00289.txt.bz2 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