Russell wrote:
Is there a way to get a copy of a "?:\" directory that includes, file name,
file create, last used, size, etc.?
It may get to the basic cost of overhead. It takes so many cycles to open a
connection, use this connection, then close it.
Is it cheaper to access files on a per file basis because the connection
time is cheap. Or is it better to access the files as a whole and deal with
it later.
If I understand you correctly, by "connection" you mean opening and
closing a file or directory, and by "copy of a directory" you mean a
copy of the metadata for the directory, including file info etc.
Well, the underlying Win32 api, FindFirstFile & friends, returns basic
info including timestamp etc. in its iteration. That would probably
imply that using DirectoryInfo and calling GetFiles() or
GetFileSystemInfos() would be faster than using Directory.GetFiles(...)
/ etc. and then using File.Get* / etc.
However, the data in the second case will almost certainly be in the OS
filesystem cache so it won't really be much slower, and the overhead of
the initial I/O in both cases will be an astronomical number of cycles
if the data isn't already in the cache, so much so that this is like
bargaining for pennies on the cost of a car.
-- Barry
--
http://barrkel.blogspot.com/