Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
config:all_you_never_wanted_to_know_about_file_saving [2013/05/02 02:59] – add tags elextr | config:all_you_never_wanted_to_know_about_file_saving [2025/02/22 21:46] (current) – Explicitly mention that use_atomic_file_saving loses links colombanw | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | |||
+ | ===== Introduction | ||
Geany has a number of options and a plugin controlling the apparently simple operation of saving a buffer to a file. This page gives a more detailed description of the options so that you can make an informed decision which to use, since no one combination is allways " | Geany has a number of options and a plugin controlling the apparently simple operation of saving a buffer to a file. This page gives a more detailed description of the options so that you can make an informed decision which to use, since no one combination is allways " | ||
Line 9: | Line 11: | ||
No matter what your options settings, if a file save fails you should try to save the buffer **to a different device** or clear the cause of the failure (disk full, network fault) and try again. | No matter what your options settings, if a file save fails you should try to save the buffer **to a different device** or clear the cause of the failure (disk full, network fault) and try again. | ||
- | ====== Various Options | + | ===== Various Options ===== |
The options controlling file saving are all in the " | The options controlling file saving are all in the " | ||
Line 21: | Line 23: | ||
* gio_unsafe_save_backup | * gio_unsafe_save_backup | ||
- | ===== use_atomic_file_saving | + | ==== use_atomic_file_saving ==== |
This is off by default. | This is off by default. | ||
Line 39: | Line 41: | ||
* Uses Geany' | * Uses Geany' | ||
- | If use_atomic_file_saving is set, use_gio_file_saving | + | If use_atomic_file_saving is set, use_gio_unsafe_file_saving |
Advantages: | Advantages: | ||
Line 49: | Line 51: | ||
* Because it writes the temporary file as a new file, it will get the permissions and other metadata (eg execute) of a new file, not those of the old file. | * Because it writes the temporary file as a new file, it will get the permissions and other metadata (eg execute) of a new file, not those of the old file. | ||
+ | * Because of renaming over the old file rather than changing its content, if the old file was a symlink the link is lost and is replaced with a new file instead, leaving the link target untouched. | ||
* Does not work on all file systems since rename or rename over an existing file is not supported on all file systems. | * Does not work on all file systems since rename or rename over an existing file is not supported on all file systems. | ||
* Uses twice as much file space during the process. | * Uses twice as much file space during the process. | ||
* Uses library code so Geany can't modify its behaviour. | * Uses library code so Geany can't modify its behaviour. | ||
- | ===== use_gio_unsafe_file_saving | + | ==== use_gio_unsafe_file_saving ==== |
This is on by the default, and is provided by the GIO library. | This is on by the default, and is provided by the GIO library. | ||
Line 73: | Line 76: | ||
Disadvantages: | Disadvantages: | ||
- | * There is a long standing bug or design fault in the GIO library that deletes the temporary file from the non-atomic save if writing the data file fails. | + | * There is a [[https:// |
* The non-atomic save copies data over the network three times (read and write to make the temporary file, write the output file) which can be slow on remote networks. | * The non-atomic save copies data over the network three times (read and write to make the temporary file, write the output file) which can be slow on remote networks. | ||
* Uses twice the disk space. | * Uses twice the disk space. | ||
Line 79: | Line 82: | ||
* Uses library code so Geany can't modify its behaviour. | * Uses library code so Geany can't modify its behaviour. | ||
- | ===== gio_unsafe_save_backup | + | ==== gio_unsafe_save_backup ==== |
This is off by default. | This is off by default. | ||
Line 93: | Line 96: | ||
Disadvantages: | Disadvantages: | ||
- | * Only works if use_gio_unsafe_file_saving is in operation, remember | + | * Only works if '' |
* Uses twice the disk space. | * Uses twice the disk space. | ||
* Can be slow on remote filesystems as it may have to read and write data to create the backup if renaming fails. | * Can be slow on remote filesystems as it may have to read and write data to create the backup if renaming fails. | ||
- | ====== Save Actions plugin | + | ===== Save Actions plugin ===== |
The Save Actions plugin is distributed with Geany and if it is enabled it provides two actions relevant to this discussion (plus others). | The Save Actions plugin is distributed with Geany and if it is enabled it provides two actions relevant to this discussion (plus others). | ||
Line 104: | Line 107: | ||
* Backup Copy | * Backup Copy | ||
- | ===== Autosave | + | ==== Autosave ==== |
Any situation that causes Geany to stop unexpectedly can cause unsaved files to be lost, that includes logout, shutdown, crash etc. | Any situation that causes Geany to stop unexpectedly can cause unsaved files to be lost, that includes logout, shutdown, crash etc. | ||
Line 121: | Line 124: | ||
* Same limitations of the chosen save method, but now happens more often. | * Same limitations of the chosen save method, but now happens more often. | ||
- | ===== Backup Copy ===== | + | ==== Backup Copy ==== |
Makes a copy of the file every time after the buffer is saved successfully. | Makes a copy of the file every time after the buffer is saved successfully. |