fsync, sync: does it really do what its supposed t

2019-02-21 14:30发布

问题:

I would like to have more clarification on the functionality of sync(8) and fsync functions in Linux (2.6.31). Does it make sure the files are written to the respective storage?

回答1:

http://linux.die.net/man/8/sync

It does not make sure that files are written to respective storage. It only makes sure that cached/buffered data is flushed to the disk device. It doesn't matter if this is an SD Card or whatever.