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:

opening c:\ drive , accessing file

however, when run code supplied @ top this:

wrong time

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

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -