in reply to Deleting a line from a file

If you know the record length and can calculate file offsets, you can use a combination of seek and syswrite to overwrite chunks of a file. Of course, since it's unbuffered and print is buffered, you can really get tied up in knots.

I'd just check the time before you print. It's a lot easier.

  • Comment on (chromatic) Re: Deleting a line from a file

Replies are listed 'Best First'.
RE: (chromatic) Re: Deleting a line from a file
by vkonovalov (Monk) on Jul 14, 2000 at 13:26 UTC
    As we know from perl documentation, this is strongly deprecated to use both print and syswrite to the same filehandle.
    It is much safer to either reopen filehandle in a different way, or suspend writing until exact output is known (for example use stack).

    It is often to not do undesireable things instead of doing them and then trying to undo.