Re: Deleting a byte at the end of a file
- From: nmm1@xxxxxxxxx
- Date: Tue, 2 Dec 2008 17:31:36 +0000 (GMT)
In article <gh3qep$t0n$1@xxxxxxxxxxxxxxxxxxxxx>, Lorents <fdsa@xxxxx> wrote:
Gary Scott wrote:
This seems to work in CVF (note extensions)
Thank you Gary, I tried it with intel compiler 9.1 under linux and it
compiled and worked! Thanks!
In my case I used a single backspace instead of two; as it is your program
will delete 2 bytes at the end of the file (it works in your example
probably because your data.txt contained a trailing end-of-line invisible
Be warned - it is SERIOUSLY non-portable. That solution will not
work on any implementation that uses Unix append to implement that
positioning. However, no other solution will be much better, because
what you are trying to do makes no sense on many systems and is a
bit iffy even on many of those where it does make sense.
So always test such code every time you use it after a compiler
or system upgrade.