Re: Tentative File Open & Safe Save

Liste des GroupesRevenir à col misc 
Sujet : Re: Tentative File Open & Safe Save
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.os.linux.misc
Date : 24. Jan 2025, 20:08:43
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vn0ofr$2c40e$1@dont-email.me>
References : 1 2
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
186282@ud0s4.net <186283@ud0s4.net> wrote:
On 1/23/25 7:39 PM, Lawrence D'Oliveiro wrote:
When developing an app, saving changes that a user has made to a document
needs to be managed carefully. Simply overwriting the existing file with
the new data can cause trouble, if your app (or the system) should crash
part-way through, because then the file ends up with some part of the old
document overwritten with the new one, and so the user ends up without a
valid copy of either the old or the new version -- in effect, all their
work is lost.
 
 
  Of course systems CAN glitch at any time, often for
  totally mysterious reasons - power maybe, minor
  coding error only hit 1:1000 times, cosmic rays ....
  so if yer stuff is SUPER important, like tax docs
  or whatever .......

Third option:

Use a Sqlite file as the "file" the app uses, and delegate all the ugly
aspects of atomic file "adjusting" and "storing" to Sqlite (which by
now has mitigations for issues most individual developers will never
see nor hear of).

Plus, a Sqlite file would allow a very easy "versioned file" setup as
well.

Downside: one has to have an Sqlite module for one's language availble,
or one has to include Sqlite's driver in one's app.


Date Sujet#  Auteur
24 Jan 25 * Tentative File Open & Safe Save5Lawrence D'Oliveiro
24 Jan 25 `* Re: Tentative File Open & Safe Save4186282@ud0s4.net
24 Jan 25  `* Re: Tentative File Open & Safe Save3Rich
25 Jan 25   `* Re: Tentative File Open & Safe Save2186282@ud0s4.net
25 Jan 25    `- Re: Tentative File Open & Safe Save1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal