Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Fastest way of changing the beginning of a txt file..by pwagyi (Monk) |
on Feb 19, 2019 at 03:35 UTC ( [id://1230132]=note: print w/replies, xml ) | Need Help?? |
>> is there any way to tell the OS some thing like: "Set actual FILEHANDLE's position as the file-start postion"??? in a way that if i close the FILEHANDLE, then the file will only have valid lines... Your best bet is to copy the only part of the file you want and write to new file, and rename the file. You cannot shrink a file nor insert in the middle in-place. you could append/overwrite at the end.
In Section
Seekers of Perl Wisdom
|
|