# HG changeset patch # User jwe # Date 1077643805 0 # Node ID da0d1c453971a75900d007d29a26bf299f16ed18 # Parent 19b8225bdaa2f2c4e4b3f32fb8a39cc96753561e [project @ 2004-02-24 17:30:05 by jwe] diff -r 19b8225bdaa2 -r da0d1c453971 src/ChangeLog --- a/src/ChangeLog Mon Feb 23 22:10:32 2004 +0000 +++ b/src/ChangeLog Tue Feb 24 17:30:05 2004 +0000 @@ -1,3 +1,8 @@ +2004-02-24 John W. Eaton + + * file-io.cc (do_stream_open): Don't call ::error if stream can't + be created. Don't call ::fopen if arch is invalid. + 2004-02-23 John W. Eaton * file-io.cc (Fftell): Return long integer instead of streamoff_array. diff -r 19b8225bdaa2 -r da0d1c453971 src/file-io.cc --- a/src/file-io.cc Mon Feb 23 22:10:32 2004 +0000 +++ b/src/file-io.cc Tue Feb 24 17:30:05 2004 +0000 @@ -338,15 +338,21 @@ oct_mach_info::float_format flt_fmt = oct_mach_info::string_to_float_format (arch); - FILE *fptr = ::fopen (name.c_str (), mode.c_str ()); + if (! error_state) + { + FILE *fptr = ::fopen (name.c_str (), mode.c_str ()); + + if (fptr) + { + retval = octave_stdiostream::create (name, fptr, md, flt_fmt); - if (fptr) - { - if (! error_state) - retval = octave_stdiostream::create (name, fptr, md, flt_fmt); + // XXX FIXME XXX -- it would now be possible for the + // file id returned by fopen to correspond directly to + // the underlying system file id (::fileno (fptr)). + // Doing that would require some changes to the + // octave_stream_list class. + } } - else - error ("fopen: failed to open file %s", name.c_str ()); } return retval;