From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26170 invoked by alias); 19 Aug 2019 14:13:26 -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 26025 invoked by uid 89); 19 Aug 2019 14:13:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-101.7 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*F:D*cygwin.com X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Aug 2019 14:13:24 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MadC8-1iW0xX3Hgo-00c69b for ; Mon, 19 Aug 2019 16:13:21 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 50CC3A8066E; Mon, 19 Aug 2019 16:13:21 +0200 (CEST) Date: Mon, 19 Aug 2019 14:26:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: find command seems to lock files Message-ID: <20190819141321.GO11632@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20190819140308.GN11632@calimero.vinschen.de> <609c28ca-07da-f150-139b-267448ede826@cs.umass.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EM2zIRCtNCod1hEe" Content-Disposition: inline In-Reply-To: <609c28ca-07da-f150-139b-267448ede826@cs.umass.edu> User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-08/txt/msg00280.txt.bz2 --EM2zIRCtNCod1hEe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1830 On Aug 19 10:06, Eliot Moss wrote: > On 8/19/2019 10:03 AM, Corinna Vinschen wrote: > > On Aug 19 14:33, Morten Kj=C3=A6rulff wrote: > > > Hi, > > >=20 > > > I have an application which constantly: > > > creates a file > > > do some processing > > > deletes the file > > >=20 > > > One way to monitor if the application has crashed, is to check the ag= e of > > > the file, so I made a script that: > > >=20 > > > find //$server/d$/dir/subdir*/subsubdir -name 'thefile' -printf '%A+\= n' > > >=20 > > > subdir* will be subdir1 subdir2 ... > > > under subsubdir there will be dirA, dirB, ... and under those, thefil= e may > > > exist. > > >=20 > > > Problem is that it seems this command locks thefile, as the applicati= on > > > sometimes can't delete it. > > >=20 > > > Could this be true? > >=20 > > Cygwin does not actually lock anything except in very rare > > circumstances. Your problem is more likely triggered by a realtime > > virus scanner. >=20 > I was wondering, though, whether the parent directory would > be non-delete-able while find has the directory open for scanning. Usually yes. Cygwin moves the entire directory into the recycler in case it's a local dir. That works even if a file is blocking the dir from deletion. > 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 --=20 Corinna Vinschen Cygwin Maintainer --EM2zIRCtNCod1hEe Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1aroEACgkQ9TYGna5E T6BFFQ//e9zB4gC4Vmv18IX0IJ3ek5rx6bvWhBhLPIJAQnNjvcRrjt4BnqkH9lRF knqxyoqsAfG7tb+o6WpxdwNNJmU/1+d+vHVYRM+hF/dbABw+HaJbiGtavkS6Hr1p Y2mzUrk/sR0Qag+ylFuBfmTxW7RgOwleIL9uWneHZudfeZVJo6Kb89qbcc68rfMN 6dvS3OMGH+OzoO510eAOyPOKqI8+/IrrXiu1C/ugENuDDGXlsyY1gVgCOr/lHdK8 vKhxsontcqwtZnf98mW/PQpdblIg649z/KvR9edc+MjrjUg3IRv+OezFeSlGFjfl 3HlL35PBfTefmPKp/cbQSnDnDQk8192joJymJekA+vrQ0qo+fg9kv2WwA2ZnF/b2 FGtLMerbXEJKqvgiz37ZCrT1WQ/2jC/jXIQ+WvVdfiklIxzsn95Uoyx/PuH8Igyt DBrbImDBF2RAZkoEYylmPfVAwDFLrNWkm/mv0h6pC5sdTE1vbwLlD818QHwhGHBy +EFq0i9q4zMy1QH8oA/smaBC1D0j09UqmQ9OxQMmB+39RnvJdp1fi5Wz+sAFsw1A Y/63OM9ljyH2g7dVZNqbfnLFy9QvZDLwHU9uOZO4aJXladNVLocaZVI63GS2ukoj qY2lToyBM3k4KCWe0Ae5XJtkTxpmx2oUw4yFKegXhIopgRgjq7I= =2ixq -----END PGP SIGNATURE----- --EM2zIRCtNCod1hEe--