Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFileStatus [modified]

CFileStatus [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    baloneyman
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • B baloneyman

      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

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      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."

      B 1 Reply Last reply
      0
      • M Mark Salsbery

        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."

        B Offline
        B Offline
        baloneyman
        wrote on last edited by
        #3

        Thanks for the quick response. Guess I'll just have to think of something else for non-ntfs drives. Roy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups