Good day.
Maybe someone has a sketch to replace the last line in the file - in a loop. Those. sort of
While(True) { заменяем последнюю строку; if($s == false) exit(''); }
Good day.
Maybe someone has a sketch to replace the last line in the file - in a loop. Those. sort of
While(True) { заменяем последнюю строку; if($s == false) exit(''); }
Change the last line ... For what?
Get the buffer variable. Read the first line there. Then cycle in rows (from the second to the end). In the loop, output the buffer variable and put the next line there. After exiting the loop in the buffer, you have the last line. Replace it with what you need and output. If the file is empty, break off on first reading.
Source: https://ru.stackoverflow.com/questions/70082/
All Articles