i’ve a (probably) stupid question: how to replace ...
# announcements
n
i’ve a (probably) stupid question: how to replace a line in a file? (i even never had this issue in java, so i don’t know how to do it in a simple way either)
t
The simple way is to copy the file line-by-line, swapping out whatever lines you want
Then atomically move the new file back over the original
There are potentially more efficient ways, but they are more complex and come with caveats
n
ok, thanks