From bug-octave-request at bevo dot che dot wisc dot edu Thu Jan 22 16:05:29 2004 Subject: frewind return From: "John W. Eaton" To: Fabian at isas-berlin dot de Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 22 Jan 2004 16:03:40 -0600 On 12-Dec-2003, Fabian at isas-berlin dot de wrote: | octave:11> OCTAVE_VERSION | OCTAVE_VERSION = 2.1.51 | octave:12> computer | i686-pc-cygwin | | It seems, that numerical 0 is returned if rewind of file is | successful, in contrast to the documentation of 'frewind' | which tells me 'ret=1' in case of success : | | | octave:13> help frewind # or help -i frewind | frewind is a built-in function | | - Built-in Function: frewind (FID) | Move the file pointer to the beginning of the file FID, returning | 1 for success, and 0 if an error was encountered. It is | equivalent to `fseek (FID, 0, SEEK_SET)'. To be more consistent with other C-style I/O functions, I changed this so that 0 is success and -1 is failure. Also, for compatibility with Matlab's frewind function, Octave's freweind now only returns a value if nargout > 0 (I also made this change for fprintf and printf). Thanks, jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------