Macos 在Mac中,fstat将始终将st_mtimespec.tv_sec设置为0

Macos 在Mac中,fstat将始终将st_mtimespec.tv_sec设置为0,macos,Macos,在Mac OS中,我有一个只读取文件的应用程序——当文件被其他应用程序修改时。为此,我使用fstat检查文件修改时间戳。下面是代码snyppet fstat(mHFile,&mCurrentTimeStamp); mCurrentTimeStamp.st_mtimespec.tv_sec will gives information up to seconds field DDMMYYY HR:MM:SS But mCurrentTimeStamp.st_mtimespe

在Mac OS中,我有一个只读取文件的应用程序——当文件被其他应用程序修改时。为此,我使用fstat检查文件修改时间戳。下面是代码snyppet

  fstat(mHFile,&mCurrentTimeStamp);

  mCurrentTimeStamp.st_mtimespec.tv_sec will gives information up to seconds field DDMMYYY HR:MM:SS

  But mCurrentTimeStamp.st_mtimespec.tv_nsec is always 0. Because of this, if the application has modified below 1 second - I wont be able to read those kind of messages.

  Reading of messages which are modified with in 1 second duration is very important for my application.

  What i have to do for this?
看看