Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Wed, 13 Jun 2001 10:58:45 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: fileutils-4.0-3
Message-ID: <20010613105845.D1144@cygbert.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <Pine.GSO.4.21.0106122003330.3791-100000@devmail.dev.tivoli.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <Pine.GSO.4.21.0106122003330.3791-100000@devmail.dev.tivoli.com>; 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@cygwin.com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

