Read-only forum archive

Writing on a file

Writing on a file

IliaToli · Tue Jan 15, 2019 5:04 am

I use the potion :a. I have launched some 8 different Singular commands in 8 different shells. I want them to write all in the same file. Is there risk that they write in the same time and the output is gibberish? Or does each of them lock the output file while it writes in it?

Danke schön.

Re: Writing on a file

hannes · Tue Jan 15, 2019 4:19 pm

That is very dangerous:
if the files are opened with mode ":a", all output goes to the same file
in undefined order, producing gibberish.
If the files are opened in mode ":w", all output but that from the last opener
disappears.