User forums > Help

[Linux] Problems when saving files on a FAT-Partition

<< < (2/3) > >>

thomas:
Looking at the wxTempFile sources, you see that it is unsafe, anyway. Typical...

Calling Commit() actually deletes a possibly existing file and then tries to rename the tempfile to the deleted file's name (which may work or not, and which may be prevented by encountering a crash or an exception).
Thus, if things go wrong for some reason, you may end up with your data not saved (the temporary file is deleted in the destructor) and the existing file deleted from disk...

Actually, it should rename the existing file, then rename the new file, and only if that was successful, delete the original (preferrably after syncing). Then at least you would keep the original file in the worst case (renamed, but nevertheless existing).

thomas:
There goes, I implemented saving documents to a temp file, not touching any file attributes, with proper renaming in the correct order, and deletion of temp files after a grace period.

Using a grace period is not ideal, but it is as good as we can do, and surely better than deleting the original file before being sure that the new file is good.
As we don't know anything about the underlying filesystem (it might even be on another physical machine), there is not much we can do to ensure all data is really synced.

This function will have to be tested for a week or two before it goes public, though.

Blue-Tiger:
woohooo :) really nice to hear this :)

sika:
Hi !
I'm using one of the last nightly and i've got the same little problem (the messagebox saying : "Failed to set temporary file permissions (error 1: Operation not permitted)").
Do you plan to fix it or not ?
thanks  :D

sika:
this messagebox is a bit annoying... no plan to include the function described by thomas ? :?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version