c# - When is a directory actually classed as been "accessed" on Windows? -
i have console application gets directory , prints out last time written , last time time accessed. using following code checking when written to: directory.getlastwritetime(path)
, following code checking when last accessed to: directory.getlastaccesstime(path)
. don't need of programmer see that, using correct methods.
now problem when pass in top level c:\ (or directory) path
, access time always matches write time. when have opened few files in top level c, not written it. see here:
however, when run code supplied @ top this:
this not time opened file. leads me believe "accessing" file not think. true, or bug somewhere?
in default configuration, windows doesn't keep track of last access times directories.
you can turn on using:
fsutil behavior set disablelastaccess 0
however, may affect system performance.
Comments
Post a Comment