I think what you are looking for may be
int fsync(int fd);
or
int fdatasync(int fd);
fsync
will flush the file from kernel buffer to the disk. fdatasync
will also do except for the meta data.
More Related Contents:
- Why does forking my process cause the file to be read infinitely
- C – list all files in current directory then move in directory above, list files, and so on until root directory is reached [closed]
- How to open, read, and write from serial port in C?
- Can I share a file descriptor to another process on linux or are they local to the process?
- Pass arguments into C program from command line
- How to list files in a directory in a C program?
- Segmentation fault handling
- Why does the C preprocessor interpret the word “linux” as the constant “1”?
- Why does ENOENT mean “No such file or directory”?
- How to compile .c file with OpenSSL includes?
- Clearing output of a terminal program Linux C/C++
- How to use printf to display off_t, nlink_t, size_t and other special types?
- `bash: ./a.out: No such file or directory` on running executable produced by `ld`
- Linking against older symbol version in a .so file
- What is the difference between using _exit() & exit() in a conventional Linux fork-exec?
- Receiving multiple multicast feeds on the same port – C, Linux
- C equivalent to fstream’s peek
- fcntl, lockf, which is better to use for file locking?
- Why getch() returns before press any key?
- Pthread Run a thread right after it’s creation
- Do threads have a distinct heap?
- Linux/POSIX equivalent for Win32’s CreateEvent, SetEvent, WaitForSingleObject
- Implicit declaration of ‘gets’
- Implementing pipe in C
- Why does this code print two times? [duplicate]
- How to detect key presses in a Linux C GUI program without prompting the user?
- Pipe two or more shell commands in C using a loop
- Size of pid_t, uid_t, gid_t on Linux
- How to print exact value of the program counter in C
- How do I lock files using fopen()?