> > Especially since the "common case", as you put it, is that the open()
> > returns ENOENT, file not found.  _That_ case may or may not be
> > expensive, but it's quite different from the usual consideration of
> > whether stat() is expensive.  Not least because stat() is usually
> > considered in context where a file _does_ exist and various information
> > about the file gets looked up to populate the stat structure.

[Ivan Zhakov]
> Btw on Windows dry open() takes a lot more time than stat(). I don't why.

Wait ... you're saying open() that returns 'file not found' is more
expensive than a stat()?  It is harder for the OS to determine that a
file does not exist and thus cannot be opened, than it is to gather
various fields of information about a file that _does_ exist?

I hate to pick on Windows for its design, because that's so cliche ...
but that sounds like a pretty poor filesystem design.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/

Reply via email to