Avoid overwriting by moving old file to backup#150
Avoid overwriting by moving old file to backup#150ahmed-shariff wants to merge 2 commits intoimmersivecognition:masterfrom
Conversation
4003e6b to
4e8776b
Compare
|
This is a nice feature, but I think it should be an option, controlled by a boolean value in the FileSaver inspector. Often I think overwriting is what is expected, if you do some setup step wrong and you restart the session you may not want all those old backup files cluttering things up. However maybe its better to move the entire session folder if old files are detected on session start? e.g. the However, the old files are still somewhat unusable, because now the relative paths in the trial results are no longer valid, since all the names have changed. The only way to fix this would be to move the data to a sibling backup folder. Any thoughts? |
|
I am of the opinion that no data should be discarded, even bad/incomplete data can be of use. Hence I opt having more files even though it might clutter the directory; that clutter doesn't bother me much with how I process data. But I see where you are coming from. I'll make that an option that can be toggled by the user. I hadn't though of the relative paths in the One option is to use relative paths (relative to the The other alternative is to move it to a backup directory without guarantees that the file-names in that backup would work without some processing? As for the backup directory, what do you think about having a backup directory at |
|
If you want to continue work on this, I have a few comments. I think the file path suggested is correct, that way relative paths still work. I would suggest a simpler implementation though, which is moving the entire directory tree over when starting a new session which has a risk of overwriting. I think this could be done inside the Additionally:
|
4e8776b to
7b8a450
Compare
|
Sorry, took a while to get back to this. I've been working on this in the background in a separate fork: https://github.com/ovi-lab/UXF-extensions I've updated this to backup the whole session directory now. Also added tests for it. |
This PR ensures the FileSaver doesn't overwrite any existing files. It creates a backup of a file about to be overwritten with it's last written time as a suffix.