in reply to Re: writing to a file
in thread writing to a file

That would overwrite from the beginning rather than append. Unless the file is small enough to read into an array, unshift the new first line in, do the same zero-seek and then print it back in this overwrite mode, a much more complex solution would be required using read aheads, rewriting the previous buffer and iterating through the whole file.

One world, one people