develooper Front page | perl.perl6.language.io | Postings from November 2000

PerlIO - what next? - (should getc get a character?)

Thread Next
From:
Nick Ing-Simmons
Date:
November 4, 2000 12:15
Subject:
PerlIO - what next? - (should getc get a character?)
Message ID:
E13s9jE-0003kv-00@serv1.is1.u-net.net

I have guts of a stack-of-layers PerlIO scheme coded now 
(//depot/perlio/... for those with perforce access - merge to 5.7.0
will occur as soon a Jarrko likes.)

So we now have a C level mechanism for all the things we said we could
do when we had "disciplines".

The front of the queue is the UTF8 stuff. But what should it look like 
at the perl level? (that is in perl5-as-prototype).

How should we open/configure a file handle for various translations?
 

Assuming a suitably opened/configured file handle:

  $a = getc($fh);          # Now reads a whole character ?

  $c = read($fh,$buf,12);  # Reads 12 characters ?

There are other messy bits - like what if the "output record separator" 
is set to UNICODE string and stream is not character aware.

Other non-UNICODE fun-things-to-try are :

"layer" or option to "perlio" to use mmap() rather than read (cf sfio).
"win32" layer that does IO straight to Handle level rather than via
MS's idea of how UNIX read/write work.


-- 
Nick Ing-Simmons


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About