From: matz@... (Yukihiro Matsumoto) Date: 2003-05-11T03:13:13+09:00 Subject: Re: PStore and tempfiles - bug? Hi, In message "Re: PStore and tempfiles - bug?" on 03/05/08, Paul Brannan writes: |I don't need a backup. It should be possible to turn this off. Why? You don't make mistake? I always do. |> q2: Why isn't it removed when the program is complete? |> a2: You can't remove a backup file. If you do, it's no longer a backup. ;-) | |There is code in pstore.rb to remove the backup file: | | if @abort and !orig | File.unlink(@filename) | end | |But orig is never false, so the backup never gets removed. I don't know |what the author's intention was, but I'm sure unreachable code was not |it. 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. |> q3: are there any potential problems associated with the tempfile or |> can I safely ignore this issue? |> a3: You can ignore it, until you need backup. | |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? matz.