3 ms·
I am talking about posix semantics yes, I have no idea how things work on windows.
by masklinn 2y ago
I am talking about posix semantics yes, I have no idea how things work on windows.
- magicalhippo 2y agoPhew. I've primarily used Windows. Not that any of the posix programs I've been exposed to have done the dir sync though. For cross-platform stuff I've mainly used Boost, which I assumed handled such details.
- guappa 2y agoI'm sure it does not. Also these things are needed very very rarely (which is why few even know about the issue) and are not good for performance and battery life.
- account42 2y agoMore specifically, these things are for trying to improve the behavior on unclean system shutdown (e.g. power loss) which is inherently chaotic and unless all parts (most critically the disk and its controller) are well behaved you don't have any real guarantees anyway. Windows also doesn't guarantee that data is written to disk by the time WriteFile/CloseHandle returns, the Windows version of fsync is FlushFileBuffers.
- red_admiral 2y agoThere's the old saying that on Windows*, files have names; in POSIX, names have files. I think that's what makes the difference here. * technically it's the filesystem as much as the OS that is relevant here.
- pixl97 2y ago* a very limited set of names in relation to what's possible on other operating systems. If your processing files from other systems on NTFS you'll very likely have rename said files in an application and store an index of the names.