delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/13/06:24:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <cygwin AT cygwin DOT com>
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: <Pine DOT GSO DOT 4 DOT 21 DOT 0106122003330 DOT 3791-100000 AT devmail DOT dev DOT tivoli DOT com>
Mime-Version: 1.0
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 AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019