From: Paul Brannan Date: 2003-05-12T23:06:49+09:00 Subject: Re: PStore and tempfiles - bug? On Sun, May 11, 2003 at 03:13:13AM +0900, Yukihiro Matsumoto wrote: > It's for the case: > > * there's not foo, but foo~. > * transaction is aborted. > > This is very rare case, but not impossible. I wanted to remove > unrelated files which look like backup files. Ah, I see. If we never reach the part of the code where the pstore gets written to disk, then there should be no backup. If one does exist, then we didn't create it on this run. The code should still be fixed so orig gets set, wherever it is supposed to be set. There's a similar case on line 102 where orig is always true. > |I agree, but note that the backup file disappears if writing to the file > |fails. You cannot depend on its existence. > > Hmm, I assume the author (me) wanted back files to exist when > > * the pstore file had existed before the transaction > * and pstore file had changed by the transaction > > So I thought it's natural to restore original file by renaming it from > the backup. If there's no backup files, we can assume no modification > has done by the last transaction. Am I wrong somewhere? You are correct. This isn't immediately obvious, though, from the code. Paul