CFileStatus [modified]
-
I'm trying to get the time when a file was last read. I'm using the following: //////////////////////////////////////////////////////////// CTime ReadTime, CreatedTime; CString sString; CFileStatus status; bool bTest = true; while(bTest) { CFile::GetStatus( "c:\\flag.txt", status ); ReadTime = status.m_atime; CreatedTime = status.m_ctime; sString = ReadTime.Format("%H %M %S"); AfxMessageBox(sString); sString = CreatedTime.Format("%H %M %S"); AfxMessageBox(sString); } /////////////////////////////////////////////////////////// The created time is okay. The read time is zero. Any suggestions? Thanks, Roy MODIFIED: The disk is fat32. I'm thinking this is the problem? Perhaps I can only use this for NTFS.
modified on Saturday, July 5, 2008 1:59 PM
-
I'm trying to get the time when a file was last read. I'm using the following: //////////////////////////////////////////////////////////// CTime ReadTime, CreatedTime; CString sString; CFileStatus status; bool bTest = true; while(bTest) { CFile::GetStatus( "c:\\flag.txt", status ); ReadTime = status.m_atime; CreatedTime = status.m_ctime; sString = ReadTime.Format("%H %M %S"); AfxMessageBox(sString); sString = CreatedTime.Format("%H %M %S"); AfxMessageBox(sString); } /////////////////////////////////////////////////////////// The created time is okay. The read time is zero. Any suggestions? Thanks, Roy MODIFIED: The disk is fat32. I'm thinking this is the problem? Perhaps I can only use this for NTFS.
modified on Saturday, July 5, 2008 1:59 PM
baloneyman wrote:
The disk is fat32. I'm thinking this is the problem?
Yes. Here's what the docs state: "On the FAT file system, the specified date for both files and directories is correct, but the time of day is always set to midnight."
-
baloneyman wrote:
The disk is fat32. I'm thinking this is the problem?
Yes. Here's what the docs state: "On the FAT file system, the specified date for both files and directories is correct, but the time of day is always set to midnight."
Thanks for the quick response. Guess I'll just have to think of something else for non-ntfs drives. Roy