i'm trying to write a line to a certain position within a file.My plan was to use FileRead to get to the position i'm looking for and then FileWrite to change the content of this line.
This doesn't work, because i cannot open a file for read & write access at the same time.I saw there is also FileGet and that stuff with cRandom access but i would like to stay with line based string access and not counting bytes in the file.
The easiest way i can think off, is to read and load the whole file to a table, apend the data you want, were you want it, and them save the file again overwriting the existing one...
You can open the file for reading.
Open a new file for writing.
Read each line from the original file and write it to the new file.
Add the new line when you reach its location.
I would like to use FileWrite and add a string (or strings) to the first line in the file. Is there a simple way or do I have to use the way you have described before as the only one solution? (L)