Questions tagged [fsync]

The fsync system call causes all modified data and attributes associated to a given file descriptor to be moved to a permanent storage device.

The fsync system call causes all modified data and attributes associated to a given file descriptor to be moved to a permanent storage device.

http://www.freebsd.org/cgi/man.cgi?query=fsync&sektion=2

101 questions
7
votes
3 answers

Git clone fsync input/output error in linux

I am trying to clone the tensorflow/models repo. I am connected to the remote machine with ssh. I tried many suggestions out there for fixing the issue but none worked for me. git clone --recursive https://github.com/tensorflow/models.git Cloning…
Utkrist Adhikari
  • 1,052
  • 3
  • 15
  • 42
7
votes
2 answers

Explanation/information sought: Windows write I/O performance with "fsync" (FlushFileBuffers)

This question is in follow up of an earlier question I posted: Windows fsync (FlushFileBuffers) performance with large files. Where I found a possible solution but also new questions. While benchmarking different scenarios for fsynced writes, I…
Alex
  • 13,024
  • 33
  • 62
7
votes
4 answers

Windows fsync (FlushFileBuffers) performance with large files

From information on ensuring data is on disk (http://winntfs.com/2012/11/29/windows-write-caching-part-2-an-overview-for-application-developers/), even in the case of e.g. a power outage, it appears that on Windows platforms you need to rely on its…
Alex
  • 13,024
  • 33
  • 62
6
votes
2 answers

Do I need to os.fsync() before f.close()?

"what exactly the python's file.flush() is doing?" says you should first f.flush() and then os.fsync(f.fileno()) to make sure the data are written to the disk. Furthermore, "does close() imply flush() in Python?" claims that f.close() implies a…
Daniel Chin
  • 174
  • 1
  • 4
  • 12
5
votes
3 answers

Writing and reading the same fd without fsync in Linux

Suppose I write a block to a file descriptor without doing fsync and then read the same block from the same descriptor some time later. Is it guaranteed that I will receive the same information? The program is single-threaded and no other process…
a sad dude
  • 2,775
  • 17
  • 20
5
votes
1 answer

How to write a file atomically and asynchronously in Linux using C

Question How can I update a file atomically without requiring my program to wait for slow physical media (such as with fsync)? My hope is that the OS could "buffer" the typical fsync and rename operations in RAM, and then write them to disk in the…
Peteman720
  • 51
  • 3
5
votes
2 answers

Does fsync(fd) work on a file created by external program?

I have a SATA hard disk with write cache disabled: hdparm -W0 /dev/foo I am operating on an ext4 partition with these mount options (amongst others): data=ordered auto_da_alloc Linux kernel version is 2.6.32-5-686. Now, I have an external program…
STenyaK
  • 1,047
  • 1
  • 8
  • 15
5
votes
1 answer

Does java.io.FileDescriptor.sync() fsync directories on Linux?

fsync(2) manpage tells syncing directory is explicitly needed if a file is synced. How about Java's sync method in io package? Does is take care about that? Does it depend on OS and/or file system? I found nothing helpful in…
ebelcrom
  • 51
  • 1
5
votes
7 answers

SD card write performance

I am writing a little application, which is writing jpeg images at a constant rate on a SD card. I choose an EXT3 filesystem, but the same behaviour was observed with an EXT2 filesystem. My writing loop looks like this…
shodanex
  • 14,975
  • 11
  • 57
  • 91
4
votes
0 answers

Which OS support an efficient file system write barrier?

Do file system or disk drivers support a concept of file system modification fence, like a memory fence in the CPU or shared memory system? A fence is an instruction that separate memory operations such that globally visible memory accesses after…
curiousguy
  • 8,038
  • 2
  • 40
  • 58
4
votes
1 answer

Am I properly forcing RocksDB to use fsync? Neither fsync() nor msync() shows in strace

I'm using RocksDB via the C API. I have a test program that opens a database, does 1,000 writes (gathering timing data between initiation of write and callback), does 1,000 reads, and shuts down. This works. Average time to do a write is about…
TJIC
  • 190
  • 5
4
votes
2 answers

Android Sqlite SQLiteDiskIOException: disk I/O error (code 1290) SQLITE_IOERR_DIR_FSYNC

I have quite a lot of customers getting the exception mentioned in the title, but i can't reproduce it on any of my devices. Bug Reports seem to suggest that the error happens only on Sony devices, but i can't seem to find any reports of Sony doing…
Pontomedon
  • 937
  • 9
  • 18
4
votes
2 answers

fsync does not write data to file

I have two (POSIX) threads that write to a log file like this: pthread_mutex_lock(&log_mutex); fprintf(LOG, "something...\n"); fsync(fileno(LOG)); pthread_mutex_unlock(&log_mutex); The file is opened in main() with fopen() with mode "a". While the…
Michael Seiwald
  • 237
  • 2
  • 7
3
votes
1 answer

What are the semantics of fdatasync() when used on a directory descriptor?

Specifically, can fdatasync be used in place of fsync if I only care about the directory structure and not timestamps or other directory metadata. If it can, does it have any performance advantages? Does POSIX define this? What do common operating…
yuri kilochek
  • 12,709
  • 2
  • 32
  • 59
3
votes
2 answers

Calling os.fsync on the stdout/stderr file descriptors kills a subprocess

After spawning a subprocess using the Python subprocess library, I'm using stderr to pass a message from the child process to the parent process containing some serialized data. I then want the parent to return (via stdin) the result of a function…
nickname
  • 1,187
  • 1
  • 9
  • 20