fileutils-4.0-3

egor duda deo@logos-m.ru
Sun Jun 17 04:36:00 GMT 2001


Hi!

Thursday, 14 June, 2001 Corinna Vinschen cygwin-patches@cygwin.com wrote:

>> >> 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.
>> 
>> CV> Wow. I just read the MSDN entry of CreateFile and I must admit
>> CV> that I always slipped over that sentence without reading it.
>> CV> It seems obvious now. If that really works (as you state),
>> CV> it would be the ultimate solution for `fstat'.
>> 
>> CV> I think you're right using some internal flag. It's not needed
>> CV> to create a new fcntl flag.
>> 
>> patch attached. i was a bit confused to discover, however, that
>> stat_worker works somehow without it. AFAICS from stat_worker code,
>> if it cannot open file, it still tries to get as much information as
>> it can, file size and times included. so, du works for me either with
>> or without this patch.

CV> The patch is fine, IMO.

unfortunately, when file resides on a remote share,
CreateFile (fname,0,...,OPEN_EXISTING,...) returns valid handle even
if file doesn't exist! i've seen this on nt4, share is nt4 too. just
try to 'touch //server/share/non-exiting-file' -- it prints "file
doesn't exist" instead of creating it.

this patch is supposed to work around it. Can anybody test it in
w9x/w2k/samba environments?

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19
query-open-2.ChangeLog
query-open-2.diff

-------------- next part --------------
2001-06-17  Egor Duda  <deo@logos-m.ru>

	* fhandler.cc (fhandler_base::open): Work around windows bug when
	CreateFile() ith dwDesiredAccess == 0 called on remote share returns
	valid handle even if file doesn't exist.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query-open-2.diff
Type: text/x-diff
Size: 867 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20010617/14340cc7/attachment.bin>


More information about the Cygwin-patches mailing list