delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/08/19/12:51:08

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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=i9rt8AvvUIIP9pZh
OMnWZNtXM8CNS3Gw10oWZ/4oPh5CUy13VLmhCeE2pntjWEP5rFHKzknAORdmmJDF
QLUn07jwAjLTpbhmSJEMgHTmmDgg7EzhyNZ4Xl7+06ksdKNdY52hhGVbXvMfZtVu
8bsVQQDC2S4phMz1+qj8txBegEc=
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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=5/Z1cKIxVqOOaJz3EWdE68
zBHhM=; b=SWBoPJsoqFCt8mGDVbse3eZpZI9epFnDwSDE51p86eI3T/b/tGsu2L
aRYT63J1XRWuM9RUXFvokbsIGeb1W6LjE1ghk2iMg9quf/HYf+ZsXoFWdzKiuL2I
wmLNQOunCkynH56RqsXLpvitxw6zM0t0v0CCVhRYS7OITZ8c83FkM=
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.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.1 spammy=H*M:yandex, lo, H*x:Bat!, H*UA:Bat!
X-HELO: forward104j.mail.yandex.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1566233401; bh=QSsPSoHNy9sD2GSb5R2eWPGOVpps76amUORouP3Ew5Q=; h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date; b=VKxAI44TGdfYBCeQ9ne5MdWsBd0Paw5OfIP/gqULSD2GL0WqKhXdmnYGUKMVIKoHD wF5X/j/3GBkBxE3XWWftQ4iPi4An7CcONalN4aOYIbtjceqjMRDLEKq0PaRxT2kHxE a3xl76SV1guDodDtA2l9f7AGRrwPnTejcs4ANaxA=
Authentication-Results: mxback15g.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Mon, 19 Aug 2019 19:42:56 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <1621839017.20190819194256@yandex.ru>
To: =?utf-8?Q?Morten_Kj=C3=A6rulff?= <mortenkjarulff AT gmail DOT com>,
cygwin AT cygwin DOT com
Subject: Re: find command seems to lock files
In-Reply-To: <CA+7cx1rZyYwdeGSJFKdzvw_Rjm_4shVY+B-3c0DJmBcqXvjuNA@mail.gmail.com>
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>
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x7JGoi6G023477

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