X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=UXe/my/2uhIKC7NK qAruCdUB6zFL9R6Wta42Gc+HZ1VeapRHxocYHvksh2FPuS5GbmcsXT/FrIeoMpZb WuaisXU7hnLaS4KFM2D8NZVv7MkRApFFx1/PQwNpO0glYC+9UV7Sw76L/Z5D2s4I az9jJA5oPkUzZ+PJHGDOHRp1PHk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=jZQ/wKM9/o5P7DI3945JY9 Xgi9w=; b=rHEqptKRKiu/xC3mtheeuJLQEX03uLiI2zii5xrhdD8/ZOIlKgFokQ tI1/u5ijpzdWdD4qz8s9GQyUDBvYsJutZZQ8sG6eF3MTcsjlzoPVdsDgoT6pT+pj VZ56HSHsYBV0SL/knCR/j9+IB5fKOFIDcILb+PK39SkXtoIdUcDqQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Reply-To: moss AT cs DOT umass DOT edu Subject: Re: find command seems to lock files To: cygwin AT cygwin DOT com References: <20190819140308 DOT GN11632 AT calimero DOT vinschen DOT de> <609c28ca-07da-f150-139b-267448ede826 AT cs DOT umass DOT edu> <20190819141321 DOT GO11632 AT calimero DOT vinschen DOT de> <1621839017 DOT 20190819194256 AT yandex DOT ru> From: Eliot Moss Message-ID: Date: Mon, 19 Aug 2019 13:41:53 -0400 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 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