# fileutils-4.0-3

Corinna Vinschen cygwin@cygwin.com
Wed Jun 13 01:58:00 GMT 2001

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

`