Written by Sman789 the 21 Mar 12 at 18:43.
Related project: Nautilus.
Files downloaded by Firefox when the user clicks 'open' instead of 'save' go to /tmp, where they are deleted after a reboot or after Firefox closes. This is fine, but sometimes editable files such as documents and images get 'opened' and edited, and then saved. Most programs (apart from image viewer) will save the file exactly where it was by default. This would be hard to solve, as every app does things in its own way, but an even more serious problem is much more easily fixed.
Programs often default to saving to the last place a file was opened or saved from, which can lead to files being saved to /tmp almost by accident if another file was opened from there or saved back to it earlier. Users may not be fully aware of this. This means they might actually save new documents or other things they need to these folders without realizing it will vanish the next time they shut down their machine.
Something like - "Warning: /tmp is a special system folder and is emptied every time the system is shut down. If you wish to keep your file, you should save it somewhere else, such as in your home folder."
If it was a warning dialogue, it could have the options:
|Save to /tmp| |Choose a different folder|
With the latter selected by default in case the user likes to press enter before they read.
-- Of course, I haven't looked at the wording of existing Ubuntu warnings, so I don't know what writing style they currently use (formal/informal/technical/brief etc). Any message would have to fit in with the existing set of warnings for other things.
By default, the file gets saved into the same directory in which it was opened (which is normal behaviour), in this case /tmp.
This idea suggests warning the user not to save in /tmp to avoid losing their file, even if the user has clicked on "Save" instead of "Save as". This situation could occur in future by other means besides using Firefox, hence the warning message to avoid losing files by accident.
As a developer, I'm trying to think how implementing solution #1 would even be possible. A back ground process could potentially watch the /tmp directory, and if a file was over written, then send a visual alert. The only issue is that the alert would appear after the file had been saved, rather than before.
@Sepero I think the only way this could work is to change the "Save" option itself, so the user is warned when they're about to save a file in /tmp. This is the only method I believe needs to be implemented.