Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #488
| From | Lusotec <nomail@nomail.not> |
|---|---|
| Newsgroups | comp.os.linux.development.apps |
| Subject | Re: file I/O: writ to disk in parallel? |
| Followup-To | comp.os.linux.development.apps |
| Date | 2012-06-21 13:33 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <jrv4b7$f6n$1@dont-email.me> (permalink) |
| References | <c7cb8f1d-73ec-45ed-9bbe-b06a6e5c140c@googlegroups.com> |
Followups directed to: comp.os.linux.development.apps
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 lmike wrote: > Say an application code calls fwrite/write etc. to write a very long > string "aaa ... 123 ... ccc" to a disk file, is it ever possible that the > app/box crashes in the middle of the write operation, then it leaves a > garbage like "aaa ... @#$@#$ ... ccc" or "@#$%@#$ ... 123 ... ccc" in the > disk file? > > Or, in other words, could the disk write head(s) (1) write parts of that > string in parallel to the disk, OR (2) write the bytes not in order, e.g. > first write "ccc", then "aaa" ... ? Any hard disks support that? Thanks! fwrite/write gives no guarantees on write order or if it is actually written to the device. This is true even if there are no crashes or power issues. If you needs *some* guarantees then look in to fsync. Regards. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EAREIAAYFAk/jFKQACgkQGQjO2ccW76qgzgD/S08n8W2Yct+sqajgN8o82sxt 1m7RAVPnCgfGlMfzfQEA/05N6X5sJfymo68o1yvNVlPn0SNs14uZ0cJy4zi3ffgF =KyMW -----END PGP SIGNATURE-----
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Next in thread | Find similar
file I/O: writ to disk in parallel? lmike <lmike3000@gmail.com> - 2012-06-20 20:35 -0700 Re: file I/O: writ to disk in parallel? Lusotec <nomail@nomail.not> - 2012-06-21 13:33 +0100 Re: file I/O: writ to disk in parallel? Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-06-21 14:17 +0100
csiph-web