Türkçe   |   English
Calendar
Categories
Archive
Links
Blogroll
Files

Reading Last Access Property of a File at Windows Vista and Windows 7 - 01.12.2009

If you are using Windows Vista or a higher version you'll see that Last Accessed attribute of the file does not change even if you accessed the file just before checking. This situation may cause problem in our programs that we need to get the last access property of a file using FileInfo object or the situation that we use FileSystemWatcher to get notified when file is accessed by using  NotifyFilters.LastAccess attribute.

For improved file system performance Last Access time update in switched off in Windows Vista by default. Thus, Last Access time attribute is set upon creating file and not changed afterwards even if file is modified. However, it is possible to enable Last Access time updates if necessary.
To enable Last Access time updates open Registry Editor by typing regedit in Search input on Start Menu, locate HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem path entry and change NtfsDisableLastAccessUpdate value data to 0. After setting Last Access time update, system has to be restarted for the change to take effect. Alternatively, run the following command with administrator rights:
fsutil behavior set disablelastaccess 0

You can visit that website

http://www.febooti.com/products/filetweak/online-help/file-last-accessed-date.html

Clues

Add Comment
First Name Last Name
Web Site
E-Mail
Comment




Photos

Los Angeles 39
Show All
Me in MSDN Forums
Entries
News
Articles