-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid overwriting by moving old file to backup #150
base: master
Are you sure you want to change the base?
Avoid overwriting by moving old file to backup #150
Conversation
444a627
to
4003e6b
Compare
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:
|
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.