Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Wed, 13 Jun 2001 10:58:45 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: fileutils-4.0-3 Message-ID: <20010613105845.D1144@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jheyman@dev.tivoli.com on Tue, Jun 12, 2001 at 08:07:08PM -0500 On Tue, Jun 12, 2001 at 08:07:08PM -0500, Jerrold Heyman wrote: > > I've made the fileutils-4.0-3 version of du available to > my users, and I have one who is reporting the following problem > running: > > du -k d:\path\to\file > "Permission Denied" > > There is another process that has the file open, and they are > using the du in a periodic loop to make sure that the disk doesn't > fill up. If they kill the process that has the file open, then the > du works successfully. > > Is there something within Cygwin.dll that keeps du from successfully > accessing the file while another process is accessing it?? Typically it's the other way around. If a Win32 application opens a file using the `CreateFile' call, it has exclusive access to the file while it's opened. If the application want's to share the file with other apps, it can do that by giving additional flags to `CreateFile' (FILE_SHARE_READ, FILE_SHARE_WRITE). Cygwin's open(2) call uses these flags by default. The problem is that `du' performs a stat(2) call which needs to open the file to get all information. Now, if the application using the file didn't open it with FILE_SHARE_READ, you're stuck. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple