Did you measure that they are? I mean, in either case the whole file is re-written, the only question is where it is. The additional operation is the rename, but nothing else

I doubt that only a rename happens, even more I am sure that not. I tried to make measure but not succedeed. They advised inotifywait application. Ufortunately it is not installed on the system currently I am using, and I did not installed just for this. Francesco Galgani explained how to use polling instead of inotifywait
https://www.baeldung.com/linux/command-execute-file-dir-change
so I followed this tutorial. I opened Geany with ~/test/test.txt empty file, pasted some Lorem Ipsum and accented characters, but not saved the file. Then executed this command:

watch --chgexit -n 0.01 "ls --all -l --full-time ~/test/ | sha256sum" && ls --all -l --full-time ~/test/

And then executed save in Geany. At that moment watch exited and the ls command was executed. But I can see only 1 file, test.txt and not the '.goutputstream-' file. The reason I think is that '.goutputstream-' file had a very little life time, so the ls comand was executed too late. But that '.goutputstream-' file was created because I could see it in PCManFM file manager for a very short time (just a blinking). And in that moment there were 2 files there: the '.goutputstream-' file and test.txt. Just this is the reason you can see clearly the change: the "list of files" grows in that moment. So, not only a rename happens. Otherwise @elextr's page confirms this:

use_gio_unsafe_file_saving
...
Disadvantages:
...
Uses twice the disk space.

An other issue:

It would actually save things if, and only if there was an environmentally efficient (and that's a big question on what is the best trade-off between more writes or more CPU cycles to avoid writes) "do not write if identical to current data" implemented in the file system (or some place down the line).

I do not really understand this. Why means a simple save more CPU cycles than saving when you use a backup file or "GIO saving"? If you talked about periodic automatic saving, yes that is other stupidity but of course I turn it off. Also turn off checking the file periodically for changes. And "do not write if identical to current data" of course is the "best trade" because this spares your storage device.

Well, hopefully it's not, but if might depend on what is actually lost. And yes, it should not happen, but when it actually does it might be painful -- and what is the cost of restoring the lost data?

I think the best solution would be (for all apps): by default: simple save without using any swap, backup, "GIO method", or other thing (also disabled automatic save, check for file changes). And if you are editing a document that is very important for you, you could switch on (only for that time/case/document) the enumerated methods for your safety. I have been editing documents for many many years but never happened that the "GIO method" saved my file.

An other solution would be using laptop with battery inside (against blackout), but the problem is that every charge cycle shortens battery life. And if you keep the battery always in laptop there will be many. Well, there would be solution: to set to not charge the battery in BIOS or until a specific charge level. My Dell laptop theoretically supports this (I can set it in BIOS) but in reality not: every time there is a power failure or simply I shutdown the laptop the BIOS "resets" the charging behaviour and the battery charges again. I really do not understand how they could make such an idiocy...

And I won't talk about not using any modern web browser, or rather website, because that's likely a nightmare

Yes, there are many many things the developers could make more environmentally friendly, efficient and logic. Unfortunately the trend is just the opposite. There must be good laws for this made by specialists. Not laws such the "cookie consent law" which is a rare stupidity and digital environmental disaster made by idiots who do not know nothing about IT. That law must be complemented by a law to force all web browser developers to ensure a standard way to set your "cookie consent" easely and globally and do not waste your time and the energy for every web site. I just lose my all zest for life after visiting a few sites...

I suggest you patch GIO itself

Yes, it seems that is a real possibilty, thank you for idea, although I am afraid it is not a very simple thing...


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/repo-discussions/3697/comments/7623120@github.com>