Corinna Vinschen
Wed Jun 13 06:31:00 GMT 2001

On Wed, Jun 13, 2001 at 03:21:59PM +0400, egor duda wrote:
> Hi!
> Wednesday, 13 June, 2001 Corinna Vinschen wrote:
> CV> Typically it's the other way around. If a Win32 application opens
> CV> a file using the `CreateFile' call, it has exclusive access to the
> CV> file while it's opened. If the application want's to share the
> CV> file with other apps, it can do that by giving additional flags
> CV> to `CreateFile' (FILE_SHARE_READ, FILE_SHARE_WRITE). Cygwin's
> CV> open(2) call uses these flags by default.
> well, CreateFile() accepts 0 as second argument, which is what we
> need-- just query information no matter if anyone opened file in
> DENYALL mode. i've just tested it on nt4.0 -- it works fine.
> the only question is whether we should add new parameter to
> fhandler::open(), say 'int cygwin_flags', or define new flag in
> fcntl.h? for me, the first one looks preferable.

Wow. I just read the MSDN entry of CreateFile and I must admit
that I always slipped over that sentence without reading it.
It seems obvious now. If that really works (as you state),
it would be the ultimate solution for `fstat'.

I think you're right using some internal flag. It's not needed
to create a new fcntl flag.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

More information about the Cygwin-developers mailing list