GetLastWriteTime always return 0 seconds
-
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:
-
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:
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[^]
-
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:
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