X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Date: Fri, 10 Sep 2010 11:46:53 +0000 From: Jurriaan To: cygwin AT cygwin DOT com Subject: quick way to find out if a file is in use by windows? Message-ID: <20100910114653.GA19315@onderneming10.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-IsSubscribed: yes 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 I use the mv command to clean up some directories filled with temporary files. These may or may not be in use by windows. I used to detect them being in use by windows by mv failing. Now, mv is simply taking forever. I'm using cygwin 1.7.7(0.230/5/3), windows 2003 server 32 bits with all updates on a local NTFS disk. I remember reading something about this changing in the last release, but I can't find it in the archives anymore (searching for 'file in use' didn't work out). Is there any way to detect if a file is in use by windows before executing 'mv' (I really, really hope I don't have to use the 'handle.exe' utility, which takes seconds for each file...)? Alternatively, could mv timeout somewhat earlier? I control-C'ed it after 15 minutes, which is really too long already. Thanks, Jurriaan -- "You want to save them all, ATerafin?" She laughed, and the laugh was chilling. "Try, try with my blessings." There was no question whatever to Margret that the words were a curse, meant to cause pain; they implied certain failure, and the amusement of the powerful at the pathetic struggles of those doomed to fail. Michelle West - The Shining Court -- 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