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. File Access Time

File Access Time

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 3 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.
  • W Offline
    W Offline
    wow9999
    wrote on last edited by
    #1

    Hi all How to get a file's last modified time? Thanks

    D V 2 Replies Last reply
    0
    • W wow9999

      Hi all How to get a file's last modified time? Thanks

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      Use the CreateFile Windows API function to get a handle to the file you wish to retrieve the date/time. Then use this function:

      BOOL GetFileTime(
      HANDLE hFile, // handle to the file
      LPFILETIME lpCreationTime, // address of creation time
      LPFILETIME lpLastAccessTime, // address of last access time
      LPFILETIME lpLastWriteTime // address of last write time
      );

      Hope that helps :-D -Dominik


      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

      1 Reply Last reply
      0
      • W wow9999

        Hi all How to get a file's last modified time? Thanks

        V Offline
        V Offline
        vcplusplus
        wrote on last edited by
        #3

        CFileStatus status; CFile::GetStatus("C:\\config.sys", status); CTime tm = status.m_mtime;

        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