Adding an atomic file write implementation to NSPR to fix some critical bugs
"Eduardo Pérez Ureta" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.nspr |
|---|---|
| Message-ID | <[email protected]> |
I would like to have fixed some critical bugs in Mozilla Firefox, like: https://bugzilla.mozilla.org/show_bug.cgi?id=226970 You can see a strace of buggy code: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=484298#17 but I need to atomically write files as I describe in this article: http://edpeur.blogspot.com/2007/11/atomic-file-writing.html I have seen there is no atomic file write implementation in NSPR and NSPR does not let me do atomic file writing as PR_Rename() will not overwrite existing files. Would you accept an atomic file write implementation in NSPR like the one at: http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#g-file-set-contents ? This implementation works in both POSIX and MSWindows. I have also seen from the strace that PR_fprintf() does not do buffering. Do not you think that being named closely like fprintf(), that actually does buffering, is misleading? Or is just that PR_fprintf() should do buffering and it is just a bug? Eduardo