[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: with-open-file/FSRead
- To: rad@teal.csn.net (Rick Dukes)
- Subject: Re: with-open-file/FSRead
- From: slh@digitool.com (Steve Hain)
- Date: Thu, 6 Apr 1995 13:20:24 -0500
- Cc: info-mcl@digitool.com
- Sender: owner-info-mcl@digitool.com
At 9:12 PM 4/5/95, Rick Dukes wrote:
>Is there a way to use FSRead (ccl:examples;mac-file-io) on a file stream
>created using with-open-file? I'm attempting to speed up copying data from
>a file stream to a tcp stream. There is a stream-copy-until-eof function
>which gets an INPUT-FILE-STREAM object and a tcp stream object. I have
>access to the tcp data buffer via a mac-ptr, but there seems to be no way
>to get the INPUT-FILE-STREAM object to use it.
>
>I have a working method using with-FSOpen-file/FSRead. I'm just wondering
>if with-open-file and FSRead can be used together.
The with-FSOpen-file macro uses FSOpen, which creates a parameter block to
be passed to FSRead and its friends. The with-open-file macro uses open,
which creates a stream instance to be passed to higher-level I/O functions.
Internally, the stream uses a structure called an FBLOCK, which contains
a parameter block. You can get the parameter block from the stream using
(ccl::%fblock.pb (slot-value stream 'ccl::fblock)). If you do this, note
two things: (1) directly manipulating the parameter block will leave the
fblock in an inconsistent state, so don't mix low-level and high-level
I/O calls; (2) these are internal details and may change in the future
(although they haven't yet for MCL 3.0).
- Steve Hain
Digitool, Inc.
______________________________________________________________________________
One Main Street 7th Floor Cambridge, MA 02142 USA
Internet: slh@digitool.com AppleLink: digitool
World Wide Web: http://www.digitool.com/
Tel: 617 441-5000 Fax: 617 576-7680