Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
config:all_you_never_wanted_to_know_about_file_saving [2013/05/02 02:59] – add tags elextrconfig:all_you_never_wanted_to_know_about_file_saving [2019/05/28 05:38] (current) – gio_unsafe_save_backup vstepaniuk
Line 1: Line 1:
-====== Introduction ======+====== All you never wanted to know about file saving ====== 
 + 
 +===== 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 "right". 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 "right".
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.  You will not lose anything until you close the buffer. 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.  You will not lose anything until you close the buffer.
  
-====== Various Options ======+===== Various Options =====
  
 The options controlling file saving are all in the "Various" preferences page. The options controlling file saving are all in the "Various" preferences page.
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's own code so it can be modified.   * Uses Geany's own code so it can be modified.
  
-If use_atomic_file_saving is set, use_gio_file_saving is ignored and Geany will use an atomic file save method.  This means that the file is first written to a temporary file, then renamed to the existing file name.  On most file systems rename is atomic, that is it succeeds completely or nothing will change, especially on modern journalling systems.  This functionality is provided and maintained by the Glib library.+If use_atomic_file_saving is set, use_gio_unsafe_file_saving is ignored and Geany will use an atomic file save method.  This means that the file is first written to a temporary file, then renamed to the existing file name.  On most file systems rename is atomic, that is it succeeds completely or nothing will change, especially on modern journalling systems.  This functionality is provided and maintained by the Glib library.
  
 Advantages: Advantages:
Line 53: Line 55:
   * 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 75:
 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.  **This means it is no more safe than the simple overwrite method since the previous data is not restored, or even left available for the user to restore.**+  * There is a [[https://bugzilla.gnome.org/show_bug.cgi?id=602412|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.  **This means it is no more safe than the simple overwrite method since the previous data is not restored, or even left available for the user to restore.**
   * 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 81:
   * 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 95:
 Disadvantages: Disadvantages:
  
-  * Only works if use_gio_unsafe_file_saving is in operation, remember use_atomic_file_saving overrides it.+  * Only works if ''use_gio_unsafe_file_saving'' is in enabled and ''use_atomic_file_saving'' is disabled (''use_atomic_file_saving'' **overrides** ''use_gio_unsafe_file_saving'').
   * 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 106:
   * 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 123:
   * 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.  If the next save fails, this backup is available. Makes a copy of the file every time after the buffer is saved successfully.  If the next save fails, this backup is available.
Print/export