Modify ↓
Opened 12 years ago
Closed 10 years ago
#7406 closed defect (fixed)
When there is an error during saving, original file is lost.
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | tested |
Keywords: | save file java7 | Cc: |
Description
Josm semms to only save over the file when saving (opening a new FileOutputStream to the file).
The right thing to do would be create a new temporary file and move the temporary file AFTER successfully writing the data over to the position of the old file (File.renameTo(..))
Just a few minutes for a core developer, but could save hours of work ;-)
Attachments (0)
Change History (4)
comment:1 Changed 11 years ago by
Keywords: | java7 added |
---|---|
Priority: | critical → normal |
comment:4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Temporary files are already used when writing .osm files and preferences files.
However, the code could be improved as we have several "copy" implementations (at least Preferences.copyFile() and OsmExporter.copy that could be simply replaced to Files.copy when we will switch to Java 7.