[Ecls-list] Binary sock I/O.
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Wed Oct 15 06:04:12 UTC 2008
On Wed, Oct 15, 2008 at 7:52 AM, David Brown <lisp at davidb.org> wrote:
> The problem seems to be that ecl_make_stream_from_fd always makes
> character streams. In fact the only way it seems to be able to get a
> binary stream is with 'open' directly.
This week I and the next one I will be upgrading the streams code to
work with POSIX file handlers. In the mean time you may either tweak
the code in file.d or copy-paste and and make your own routine.
Actually I do not understand why I did not use binary mode, since it
is used elsewhere in ECL.
Juanjo
cl_object
ecl_make_binary_stream_from_fd(cl_object fname, int fd, enum ecl_smmode smm)
{
char *mode; /* file open mode */
FILE *fp; /* file pointer */
switch(smm) {
case smm_input:
mode = "rb";
break;
case smm_output:
mode = "wb";
break;
case smm_io:
mode = "wb+";
break;
.... Rest is the same
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list