From: hlu@eecs.wsu.edu (HJ Lu) Subject: READ ME PLEASE (Re: Perl vs Iostream) Date: 21 Apr 1993 20:11:26 GMT
In article <1993Apr21.145358.3456@dcs.warwick.ac.uk>, alfie@dcs.warwick.ac.uk (Nick Holloway) writes:
|> I have a perl script that I use to manufacture holes in files where
|> possible to minimise the disk space used. The problem is that it doesn't
|> work under Linux (whose stdio is Gnu iostream).
|>
|> The script uses 'sysread' and 'syswrite' to get the data in and stuff
|> it out again. When there is a block containing nuls, it uses 'seek'.
|>
|> Under SunOS, the following script does what I want:
|>
|> $buf = 'x' x 1024;
|> syswrite ( STDOUT, $buf, 1024 );
|> seek ( STDOUT, 1024, 1 );
|> syswrite ( STDOUT, $buf, 1024 );
|>
|> In that I have a file of 3072 bytes. However, under Linux, I end up with
|> a file of 2048 bytes. The iostream, which performs the seek, positions
|> the file relative to the place _it_ has written, which is that start of
|> the file.
|>
|> What should I be campaigning for:
|> o Iostream to do what I want it to ?
|> o Perl to have a 'syslseek' ?
|> o People to tell me why I didn't just use 'read' and 'write' anyway ?
|>
When you report a possible bug, you should always say which version of
libc you are using. At least, post
ls -l /lib
Please try libc 4.3.3. It fixed lots of stdio bugs.
H.J.