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
tddmonkey
04/15/2019, 10:18 AM
The simple way is to copy the file line-by-line, swapping out whatever lines you want
tddmonkey
04/15/2019, 10:18 AM
Then atomically move the new file back over the original
tddmonkey
04/15/2019, 10:18 AM
There are potentially more efficient ways, but they are more complex and come with caveats