[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sys* behaviour changed in MacPerl 5.2.0r4



bart.mediamind@tornado.be (Bart Lateur) writes:
>I've noticed that the sys* keywords' behaviour has changed in recent
>MacPerl ports.

Your Subject: line is probably misleading; I'm pretty sure that any change in
this area would have been caused by the switch to Sfio (around 5.1.4, as far as
I recall).

>This caused some mysterious bugs in scripts that used to work, so a general
>warning is in place.

Uh, you mean something like:

             If you want to position file for sysread() or
             syswrite(), don't use seek() -- buffering makes its
             effect on the file's system position unpredictable
             and non-portable.  Use sysseek() instead.

Look in the manual under seek, and you will find exactly this paragraph :-)

>You can no longer intermix sysread with seek. It doesn't work any more. 
>
>That wouldn't be that bad, just use sysseek instead, BUT: there is no
>"tell" counterpart.

sysseek always returns the end position, so

sysseek FILE, 0, 0

is the equivalent of "tell".

Matthias

-- 
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "If you expect to find truth here, beware, lest you leave a greater fool
   than when you entered" -- Anon. (Andreas Osiander), Introduction to
                             Nicolaus Copernicus, _De revolutionibus orbium_

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch