in reply to Re^2: Deleting EOF from a file
in thread Deleting EOF from a file
produces...use strict; use warnings; use Fcntl; my $stream; # 'or die ...' removed for clarity sysopen(DUMMY, "dummy.txt", O_RDWR | O_BINARY); my $bytes_read = read DUMMY, $stream, 128; for ( my $i=0; $i<= $bytes_read; $i++ ){ my $char = substr( $stream, $i, 1 ); print $i, ": ", ord( $char ), " => *", $char, "*\n"; }
Nowhere near it (not even new lines). I found the docs quite intimidating, clearly the cross platform issues are tricky. (I was reading one article that mentioned CP/M!)0: 97 => *a* 1: 97 => *a* 2: 97 => *a* 3: 97 => *a* ... etc 98: 97 => *a* 99: 98 => *b* 100: 0 => **
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Deleting EOF from a file
by graff (Chancellor) on Jul 17, 2004 at 15:18 UTC | |
by wfsp (Abbot) on Jul 17, 2004 at 16:06 UTC |