Re: OS.File and shutdown

2013-05-15 Thread David Rajchenbach-Teller
On 5/14/13 8:35 PM, Felipe Gomes wrote: Should profile-before-change then be my call to stop accepting changes to the data and call writeAtomic to flush it? I've seen some code nearby doing it at quit-application-granted. Or perhaps there's no correct answer and it varies case by case (or

Re: OS.File and shutdown

2013-05-15 Thread Robert Kaiser
Felipe Gomes schrieb: What prompted the question is that I'm working on a conversion from SQLite storage to a JSON file. OS.File.writeAtomic provides a good guarantee of data consistency against crashes etc, and I'm now looking how to guarantee a proper full flush of the data to disk during

Re: OS.File and shutdown

2013-05-14 Thread Felipe Gomes
On Friday, May 10, 2013 7:53:01 PM UTC-3, Benjamin Smedberg wrote: I'm not sure about the rest of this question. But you should not be performing any I/O after profile-before-change. See https://wiki.mozilla.org/XPCOM_Shutdown and note that after profile-before-change, we are working

Re: OS.File and shutdown

2013-05-13 Thread David Rajchenbach-Teller
On 5/10/13 10:45 PM, Felipe Gomes wrote: Hi, does OS.File guarantees that write tasks that have started will be completed if a shutdown occurs? My use case is for writeAtomic but I'm interested about the behavior of both write and writeAtomic. Corner case: what if I call write/writeAtomic

Re: OS.File and shutdown

2013-05-10 Thread Benjamin Smedberg
On 5/10/13 4:45 PM, Felipe Gomes wrote: Hi, does OS.File guarantees that write tasks that have started will be completed if a shutdown occurs? My use case is for writeAtomic but I'm interested about the behavior of both write and writeAtomic. Corner case: what if I call write/writeAtomic from