From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4562 invoked by alias); 25 Aug 2019 20:08:04 -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 4553 invoked by uid 89); 25 Aug 2019 20:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=opening, H*r:esmtpa, HX-Spam-Relays-External:esmtpa, H*RU:esmtpa X-HELO: www16.qth.com Received: from www16.qth.com (HELO www16.qth.com) (69.16.238.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Aug 2019 20:08:02 +0000 Received: from [127.0.0.1] (port=59756 helo=www16.qth.com) by www16.qth.com with esmtpa (Exim 4.92) (envelope-from ) id 1i1ynw-001np6-VO for cygwin@cygwin.com; Sun, 25 Aug 2019 15:08:01 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 26 Aug 2019 01:57:00 -0000 From: Chris Wagner To: cygwin@cygwin.com Subject: Re: find command seems to lock files In-Reply-To: References: Message-ID: <26a08c26b5acb89631981fc69425446a@plebeian.com> X-Sender: wagnerc@plebeian.com User-Agent: Roundcube Webmail/1.3.8 X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00324.txt.bz2 On 2019-08-19 8:33 am, Morten Kjærulff wrote: > find //$server/d$/dir/subdir*/subsubdir -name 'thefile' -printf '%A+\n' > > Problem is that it seems this command locks thefile, as the application > sometimes can't delete it. Unfortunately, yes. On Windows, a "full stat" requires that the file be opened. This is why Perl has the ${^WIN32_SLOPPY_STAT} flag variable. https://metacpan.org/pod/distribution/perl/pod/perlvar.pod#${^WIN32_SLOPPY_STAT} > ${^WIN32_SLOPPY_STAT} > > If this variable is set to a true value, then stat() on Windows will > not try to open the file. This means that the link count cannot be > determined and file attributes may be out of date if additional > hardlinks to the file exist. On the other hand, not opening the file is > considerably faster, especially for files on network drives. > -Chris -- 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