File modified time not updating under windows - expected behaviour? #2644
-
Gday, I'm sorry if this has been pointed out before (I expect it has, but I can't find any previous issues with my searches). I'm using rotating_file_sink, and everything is working as expected. Logs are regularly flushing to disk, and I can verify by reloading the file in an editor etc. Interestingly, the file modified time in windows doesn't update until the file rotates, even though regular writes are happening. I understand this might be expected behaviour, but I'd like to know why this happens? I got to the point of seeing that there's fsopen and std::fwrite under the hood, and MS doco that I found for those functions doesn't mention anything about timestamps etc. The reason for stumbling accross this is that "follow" mode in notepad++ wasn't working (similar to how I might tail a log under linux), so I guess someone else would have raised this before? Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
spdlog does not explicitly call the API to change the Last Modified Date. Stack Overflow has a very similar question and a great answer on when Last Modified Date changes in Windows OS. Quote answer (https://stackoverflow.com/a/51617747):
|
Beta Was this translation helpful? Give feedback.
spdlog does not explicitly call the API to change the Last Modified Date.
This is due to the behavior of the Windows OS and file system.
Stack Overflow has a very similar question and a great answer on when Last Modified Date changes in Windows OS.
Quote answer (https://stackoverflow.com/a/51617747):