Modify ↓
Opened 16 months ago
Last modified 2 months ago
#7406 new defect
When there is an error during saving, original file is lost.
| Reported by: | anonymous | Owned by: | team |
|---|---|---|---|
| Priority: | normal | 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 (2)
comment:1 Changed 4 months ago by Don-vip
- Keywords java7 added
- Priority changed from critical to normal
comment:2 Changed 2 months ago by Don-vip
In 5874/josm:
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.