delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/08/19/13:22:42

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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
q=dns; s=default; b=uSIoewFTlHhw6Zr/8hC3fN1YMn2X5HPR6LBlaEcKiaf
jeomOzOFnokQM15nX7BkmZiif1bUMAbFvxW2TKx9kNU9PfdHXdzPgWxgq7hW20Ug
TmP0cNOcFsJ1hduUp8dgE4dx1dysJGLGHOGraDRkCoFhmjsnx+ESQz26HDJEalMQ
=
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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
s=default; bh=D45St+r0gJCH63C8keXAnnfSAgI=; b=oo+EenMR09DDc5+8H
okt9b6gITH3ugduuUnn+GGrtdQAblTPRFrLnx9tV6ySp2dPVTRH0tRJvBoiaPABj
XRFsHbH2sA/P9F0lU9KbB5zLeMyaQpAgD6pqhlKseBIteISPzjnejsmSh1XkfJQG
VhLTFVBGSlLHPg4CvKG3S2u2lg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Greetings, lo
X-HELO: mail-qk1-f182.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=qeGo5xtDTKfQ/mgLies4c21+Zahq7MF2PIQDCf9W/Co=; b=KwAm8cOKKMLqc5vWoTqfPNF1b6OHyu23/bV/3+cjKiJoyJS7SnjN1UTG30wjMadbsk b+BKeNOIp4wTX63j+e5eRtJ6BukwU85qHXvMB0quf9wlnxQk7wG9ysXP0v8tVvSEKuIk qhoe/C80kd7+sSntrPIrTsvPhL9APD3BWBjq+S38gcD3hobnNdRhDFCR+O65BXTulhPR +R042AeHzlU6dJdNSQKI0/nT/JSuFIrWsVNn3jtPaehuiz3wMmMflyJ51c5sL/kAZi1a IBFhPSrc9o7Exqg3nNdeQvuNGyy81oW94KgSl2IQKnJn99z5ebS/ScPSMBX4+J2mYwHW Jiyg==
MIME-Version: 1.0
References: <CA+7cx1rwShfSJYJZdvSF-8ERaAQqcYxtQquKKB8xwoBxqhLVog AT mail DOT gmail DOT com> <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> <CA+7cx1rZyYwdeGSJFKdzvw_Rjm_4shVY+B-3c0DJmBcqXvjuNA AT mail DOT gmail DOT com> <1621839017 DOT 20190819194256 AT yandex DOT ru>
In-Reply-To: <1621839017.20190819194256@yandex.ru>
From: =?UTF-8?Q?Morten_Kj=C3=A6rulff?= <mortenkjarulff AT gmail DOT com>
Date: Mon, 19 Aug 2019 19:21:33 +0200
Message-ID: <CA+7cx1ooYni5-rxMZd8DYWKMkrEz56Ui-+xbPUY+-HJKbRdMDg@mail.gmail.com>
Subject: Re: find command seems to lock files
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x7JHMN9Y026964

On Mon, Aug 19, 2019 at 6:50 PM Andrey Repin <anrdaemon AT yandex DOT ru> wrote:
>
> Greetings, Morten Kjærulff!
>
> >>
> >> > If the application in question creates and deletes the parent
> >> > directory, as well as the leaf file, then things would be left
> >> > around unexpectedly.
> >>
> >> The question was just if the file is locked.
> >>
> >> > So would use of find trigger a virus scanner, which in turn might
> >> > hold on to the file and prevent its deletion?
> >>
> >> That's how some realtime scanners work.  They have hooks in the file API
> >> and if some other process opens a file these scanners open the file as
> >> well, typically without FILE_SHARE_DELETE, which Cygwin uses by default.
> >>
> >>
> >> Corinna
> >>
> >> --
> >> Corinna Vinschen
> >> Cygwin Maintainer
>
> > I forgot to say that I run the find command on my own PC, and the
> > application runs on a server, which I have 'net use' its disk.
>
> > Would it be the virus scanner on my PC or on the server?
> > Any idea of a different way to get the age of the file? (I am sure I
> > cannot change the virus scanner).
>
> To begin with, the results of your `find` calls will be at least 5 seconds
> stale over CIFS share with default settings.
> Said that, you could safely write something like
>
> find /xx -type а -iname "zzz" -mtime +10s -execdir 'msg * "Achtung programme crash boom!"'
>
> In regard to antivirus,
>
> 1. first make sure your local AV does not scan network directories by default.
> This is a gigantic usability issue for multiple reasons and normally is never done.
> 2. if possible, check what exactly happens when your program loсks up.
> Yes, as said above, find will lock /directories/ it is scanning.
> This is how Windows filesystem API works.
> But it should not lock files by itself.
>
>
> --
> With best regards,
> Andrey Repin
> Monday, August 19, 2019 19:36:25
>
> Sorry for my terrible english...

Thanks.

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?

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

/Morten

--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019