Such flags as O_DIRECT, O_SYNC, O_DSYNC can be used to specify synchronous / asynchronous IO at the time when descriptor is created (create syscall). But is it possible to use this flags for distinct write (or similar) syscalls in order to make some of them synchronous? Answer is it possible to use this flags for distinct write (or similar) syscalls
Tag: fsync
Redirected output from a subprocess call getting lost?
I have some Python code that goes roughly like this, using some libraries that you may or may not have: Basically, I’m starting a subprocess that’s supposed to go download some data for me and print it to standard out. I’m redirecting that data to a file, and then, as soon as the subprocess call returns, I’m closing my handle
Is rename() without fsync() safe?
Is it safe to call rename(tmppath, path) without calling fsync(tmppath_fd) first? I want the path to always point to a complete file. I care mainly about Ext4. Is the rename() promised to be safe in all future Linux kernel versions? A usage example in Python: Answer No. Look at libeatmydata, and this presentation: Eat My Data: How Everybody Gets File