core: add option weechat.look.save_config_with_fsync (closes #1083)

This makes the save of all configuration files about 20 to 200x slower
(according to the storage device speed); so this is disabled by default.
v2.8-utf8proc
Sébastien Helleu 2017-10-14 07:56:02 +02:00
parent d427fc0549
commit 0db48c7291
23 changed files with 157 additions and 14 deletions

View File

@ -30,6 +30,7 @@ New features::
Improvements::
* core: add option weechat.look.save_config_with_fsync (issue #1083)
* api: add argument "recurse_subdirs" in function exec_on_files()
* script: add local variable "filter" in the script buffer (issue #1037)

View File

@ -1094,6 +1094,12 @@
** Werte: on, off
** Standardwert: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** Beschreibung: pass:none[use fsync to synchronize the configuration file with the storage device (see man fsync); this is slower but should prevent any data loss in case of power failure during the save of configuration file]
** Typ: boolesch
** Werte: on, off
** Standardwert: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** Beschreibung: pass:none[beim Beenden wird das aktuelle Layout gesichert (Buffer, Fenster oder beides)]
** Typ: integer

View File

@ -1094,6 +1094,12 @@
** values: on, off
** default value: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** description: pass:none[use fsync to synchronize the configuration file with the storage device (see man fsync); this is slower but should prevent any data loss in case of power failure during the save of configuration file]
** type: boolean
** values: on, off
** default value: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** description: pass:none[save layout on exit (buffers, windows, or both)]
** type: integer

View File

@ -1094,6 +1094,12 @@
** valeurs: on, off
** valeur par défaut: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** description: pass:none[utiliser fsync pour synchroniser le fichier de configuration avec le périphérique de stockage (voir man fsync) ; cela est plus lent mais devrait éviter toute perte de données en cas de panne de courant durant la sauvegarde du fichier de configuration]
** type: booléen
** valeurs: on, off
** valeur par défaut: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** description: pass:none[sauvegarder la disposition en quittant (tampons, fenêtres, ou les deux)]
** type: entier

View File

@ -1094,6 +1094,12 @@
** valori: on, off
** valore predefinito: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** descrizione: pass:none[use fsync to synchronize the configuration file with the storage device (see man fsync); this is slower but should prevent any data loss in case of power failure during the save of configuration file]
** tipo: bool
** valori: on, off
** valore predefinito: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** descrizione: pass:none[save layout on exit (buffers, windows, or both)]
** tipo: intero

View File

@ -1094,6 +1094,12 @@
** 値: on, off
** デフォルト値: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** 説明: pass:none[use fsync to synchronize the configuration file with the storage device (see man fsync); this is slower but should prevent any data loss in case of power failure during the save of configuration file]
** タイプ: ブール
** 値: on, off
** デフォルト値: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** 説明: pass:none[終了時にレイアウトを保存 (バッファ、ウィンドウ、両方)]
** タイプ: 整数

View File

@ -1094,6 +1094,12 @@
** wartości: on, off
** domyślna wartość: `+on+`
* [[option_weechat.look.save_config_with_fsync]] *weechat.look.save_config_with_fsync*
** opis: pass:none[use fsync to synchronize the configuration file with the storage device (see man fsync); this is slower but should prevent any data loss in case of power failure during the save of configuration file]
** typ: bool
** wartości: on, off
** domyślna wartość: `+off+`
* [[option_weechat.look.save_layout_on_exit]] *weechat.look.save_layout_on_exit*
** opis: pass:none[zapisz układ przy wyjściu (bufory, okna lub oba)]
** typ: liczba

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:32+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3462,6 +3462,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "uložit soubor s nastavením při ukončení"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
#, fuzzy
msgid "save layout on exit (buffers, windows, or both)"
msgstr "uložit rozložení při ukončení (buffery, okna nebo obojí)"

View File

@ -19,7 +19,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-09-09 17:44+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@ -4154,6 +4154,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "die aktuelle Konfiguration wird beim Beenden automatisch gesichert"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""
"beim Beenden wird das aktuelle Layout gesichert (Buffer, Fenster oder beides)"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:32+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3631,6 +3631,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "guardar archivo de configuración al salir"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
#, fuzzy
msgid "save layout on exit (buffers, windows, or both)"
msgstr "guardar esquema al salir (buffers, ventanas o ambos)"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"PO-Revision-Date: 2017-09-05 07:27+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-10-14 07:48+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -4045,6 +4045,16 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "sauvegarder la configuration en quittant"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
"utiliser fsync pour synchroniser le fichier de configuration avec le "
"périphérique de stockage (voir man fsync) ; cela est plus lent mais devrait "
"éviter toute perte de données en cas de panne de courant durant la "
"sauvegarde du fichier de configuration"
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""
"sauvegarder la disposition en quittant (tampons, fenêtres, ou les deux)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:32+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3021,6 +3021,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "beállítások mentése kilépéskor"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:32+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3740,6 +3740,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "salva file di configurazione all'uscita"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
#, fuzzy
msgid "save layout on exit (buffers, windows, or both)"
msgstr "salva layout all'uscita (buffer, finestre, o entrambi)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-09-10 09:00+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@ -3891,6 +3891,12 @@ msgstr "リードマーカー行の表示に使われる文字列 (行末まで
msgid "save configuration file on exit"
msgstr "終了時に設定ファイルを保存"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr "終了時にレイアウトを保存 (バッファ、ウィンドウ、両方)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-07-22 12:55+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3987,6 +3987,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "zapisz plik konfiguracyjny przy wyjściu"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr "zapisz układ przy wyjściu (bufory, okna lub oba)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-07-22 12:55+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@ -3960,6 +3960,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "guardar o ficheiro de configuração ao sair"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr "guardar a disposição ao sair (buffers, janelas ou ambos)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:33+0200\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3636,6 +3636,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "salva arquivo de configuração na saída"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
#, fuzzy
msgid "save layout on exit (buffers, windows, or both)"
msgstr "salva disposição na saída (buffers, janelas, ou ambos)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:33+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -3054,6 +3054,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr "сохранять конфигурационный файл при выходе"
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2017-06-26 23:33+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2756,6 +2756,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr ""
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2017-09-05 07:26+0200\n"
"POT-Creation-Date: 2017-10-14 07:47+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2752,6 +2752,12 @@ msgstr ""
msgid "save configuration file on exit"
msgstr ""
msgid ""
"use fsync to synchronize the configuration file with the storage device (see "
"man fsync); this is slower but should prevent any data loss in case of power "
"failure during the save of configuration file"
msgstr ""
msgid "save layout on exit (buffers, windows, or both)"
msgstr ""

View File

@ -2455,6 +2455,17 @@ config_file_write_internal (struct t_config_file *config_file,
if (fflush (config_file->file) != 0)
goto error;
/*
* ensure the file is really written on the storage device;
* this is disabled by default because it is really slow
* (about 20 to 200x slower)
*/
if (CONFIG_BOOLEAN(config_look_save_config_with_fsync))
{
if (fsync (fileno (config_file->file)) != 0)
goto error;
}
/* close temp file */
fclose (config_file->file);
config_file->file = NULL;

View File

@ -178,6 +178,7 @@ struct t_config_option *config_look_read_marker;
struct t_config_option *config_look_read_marker_always_show;
struct t_config_option *config_look_read_marker_string;
struct t_config_option *config_look_save_config_on_exit;
struct t_config_option *config_look_save_config_with_fsync;
struct t_config_option *config_look_save_layout_on_exit;
struct t_config_option *config_look_scroll_amount;
struct t_config_option *config_look_scroll_bottom_after_switch;
@ -3347,6 +3348,17 @@ config_weechat_init_options ()
NULL, NULL, NULL,
&config_change_save_config_on_exit, NULL, NULL,
NULL, NULL, NULL);
config_look_save_config_with_fsync = config_file_new_option (
weechat_config_file, ptr_section,
"save_config_with_fsync", "boolean",
N_("use fsync to synchronize the configuration file with the storage "
"device (see man fsync); this is slower but should prevent any "
"data loss in case of power failure during the save of "
"configuration file"),
NULL, 0, 0, "off", NULL, 0,
NULL, NULL, NULL,
&config_change_save_config_on_exit, NULL, NULL,
NULL, NULL, NULL);
config_look_save_layout_on_exit = config_file_new_option (
weechat_config_file, ptr_section,
"save_layout_on_exit", "integer",

View File

@ -229,6 +229,7 @@ extern struct t_config_option *config_look_read_marker;
extern struct t_config_option *config_look_read_marker_always_show;
extern struct t_config_option *config_look_read_marker_string;
extern struct t_config_option *config_look_save_config_on_exit;
extern struct t_config_option *config_look_save_config_with_fsync;
extern struct t_config_option *config_look_save_layout_on_exit;
extern struct t_config_option *config_look_scroll_amount;
extern struct t_config_option *config_look_scroll_bottom_after_switch;