Mercurial > hg > octave-lyh
diff src/syscalls.cc @ 3340:585a8809fd9b
[project @ 1999-11-05 07:02:30 by jwe]
author | jwe |
---|---|
date | Fri, 05 Nov 1999 07:02:36 +0000 |
parents | 02866242d3ae |
children | 14cfc9475fe4 |
line wrap: on
line diff
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -108,13 +108,13 @@ if (nargin == 2) { - octave_stream *old_stream = octave_stream_list::lookup (args(0)); - octave_stream *new_stream = octave_stream_list::lookup (args(1)); + octave_stream old_stream = octave_stream_list::lookup (args(0)); + octave_stream new_stream = octave_stream_list::lookup (args(1)); - if (! error_state) + if (old_stream.is_valid () && new_stream.is_valid ()) { - int i_old = old_stream->file_number (); - int i_new = new_stream->file_number (); + int i_old = old_stream.file_number (); + int i_new = new_stream.file_number (); if (i_old >= 0 && i_new >= 0) { @@ -598,14 +598,11 @@ retval(2) = msg; else { - FILE *in_file = fdopen (fid[0], "r"); - FILE *out_file = fdopen (fid[1], "w"); + FILE *ifile = fdopen (fid[0], "r"); + FILE *ofile = fdopen (fid[1], "w"); - octave_istdiostream *is - = new octave_istdiostream (string (), in_file); - - octave_ostdiostream *os - = new octave_ostdiostream (string (), out_file); + octave_stream is = octave_istdiostream::create (string (), ifile); + octave_stream os = octave_ostdiostream::create (string (), ofile); octave_value_list file_ids;