is there a way to edit a file without having to store the whole file into a buffer then edit then write back to the file??
kind of like the overwriteing a word or line??
is there a way to edit a file without having to store the whole file into a buffer then edit then write back to the file??
kind of like the overwriteing a word or line??
If the word or line after you change it is the same size as the original value, then you can do it.
I'm afraid not, for the program to do something you've got in mind, the program must have the whole file in memory. Then again, I'm not an expert, and never tried this, so I could be wrong..
Bagpipes – putting the fun back in funeral.
> is there a way to edit a file without having to store the whole file into a buffer then edit then write back to the file??
Like for example 'sed', which reads in a line, decides what to do about it based on a bunch of rules you specify, then optionally writes out a (modified) line.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.