0

I wanna write a program that get the last modified date of a file. I wanna compile this code in windows, linux and mac ...

sys/stat.h is for linux only

I can't find a cross-platform library that do this! Should I use something like this:

#ifdef __APPLE__
#ifndef st_mtime
#define st_mtime st_mtimespec.tv_sec
#endif
#endif
Mehran Meidani
  • 341
  • 1
  • 13
  • You have to write the code for each pataform yourself. This shouldn't be too hard. – Jabberwocky Sep 19 '14 at 09:16
  • And standard C runs on platforms which has no file change time, too. That´s one reason why there isn´t something like that. – deviantfan Sep 19 '14 at 09:26
  • 2
    Answered here: http://stackoverflow.com/questions/9342789/how-to-get-file-modification-time-in-c-under-multiple-os – GlGuru Sep 19 '14 at 09:47

0 Answers0