Hi,
I want to atomically change file content.
Will the scenario work?:
1. cp config.oryg config.change
2. do some changes on config.change
3. sync
4. mv config.change config.oryg
5. sync
I would like to be sure that:
1. after point 3 in case of system crash the file config.change will be
visible on disk and have correct data
2. after point 4 in case of system crash in config.oryg I have correct
config.change or correct config.oryg data (depends when metadata are
flushed)
3. after point 5 in case of system crash in config.oryg I have data from
config.change
Of course I assume that config.oryg and config.change are on the same
filesystem.
Regards,
Olaf
--
Olaf FrÄczyk <olaf@xxxxxxxxxxxxx>
|