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. GetLastWriteTime always return 0 seconds

GetLastWriteTime always return 0 seconds

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
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.
  • P Offline
    P Offline
    pc_dev
    wrote on last edited by
    #1

    In my MFC application i am reading remote directory of a unix system, using CFtpFileFind class it returns the file names along with times but the seconds field is always zero, here is the code CFtpFindFile finder ....... .......... .......... CTime ct; .......... .......... finder.GetLastWriteTime(ct); int hour = ct.GetHour(); // fine int min = ct.GetMinute(); // fine int secs = ct.GetSecond(); // always zero on unix sys //its not zero Please help why its so, or there is some other method to read seconds. Thanks in advance:rose:

    C L 2 Replies Last reply
    0
    • P pc_dev

      In my MFC application i am reading remote directory of a unix system, using CFtpFileFind class it returns the file names along with times but the seconds field is always zero, here is the code CFtpFindFile finder ....... .......... .......... CTime ct; .......... .......... finder.GetLastWriteTime(ct); int hour = ct.GetHour(); // fine int min = ct.GetMinute(); // fine int secs = ct.GetSecond(); // always zero on unix sys //its not zero Please help why its so, or there is some other method to read seconds. Thanks in advance:rose:

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      I think you'll have to show some more code. It's not clear how you have actually 'found' any file since there has to be at least one call to FindNextFile. Also, I'd check the return value of GetLastWriteTime() just to be sure that it returns TRUE.

      Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

      1 Reply Last reply
      0
      • P pc_dev

        In my MFC application i am reading remote directory of a unix system, using CFtpFileFind class it returns the file names along with times but the seconds field is always zero, here is the code CFtpFindFile finder ....... .......... .......... CTime ct; .......... .......... finder.GetLastWriteTime(ct); int hour = ct.GetHour(); // fine int min = ct.GetMinute(); // fine int secs = ct.GetSecond(); // always zero on unix sys //its not zero Please help why its so, or there is some other method to read seconds. Thanks in advance:rose:

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Did you check your unix system records file times with better than 1 minute resolution? just log in and use some interactive commands such as "ll". :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google


        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