help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir return status changed from 2.7.2 to 2.9.4


From: Jean-Francois Cardoso
Subject: Re: mkdir return status changed from 2.7.2 to 2.9.4
Date: Tue, 17 Jan 2006 11:50:44 +0100

On Jan 16, John W. Eaton wrote:
 > On 16-Jan-2006, Jean-Francois Cardoso wrote:
 > 
 > | The meaning of the return code of function mkdir has changed from
 > | 2.7.2 to 2.9.4 (see the help texts below).
 > 
 > The behavior was changed for compatibility with Matlab, so no, the
 > change won't be reversed.
 > 
 > | Otherwise, is there a decent way to write code which would run under
 > | both 2.1.xx and 2.9.xx ?
 > 
 > I guess you could look at the version number if you must have your
 > code working with both old and new versions of Octave (and/or
 > Matlab).

Thanks John.  

It just occured to me that an alternate solution could be testing the
emptiness of the returned MSG error message.  The help texts for
2.1.xx and 2.9.xx both say that MSG is empty in case of success and
"system dependent" for failure.

Now, strictly speaking, "system dependent" does not imply "non empty".
Or maybe it does?

So my question is: Do we have a guarantee, on all platforms, that

   sucess/failure == empty/nonempty (MSG) ?


Best, JF



================================================================
GNU Octave, version 2.1.72 (i686-pc-linux-gnu).
octave:1> help mkdir
mkdir is a built-in function

 -- Built-in Function: [ERR, MSG] = mkdir (DIR)
     Create a directory named DIR.

     If successful, ERR is 0 and MSG is an empty string.  Otherwise,
     ERR is nonzero and MSG contains a system-dependent error message.

================================================================
GNU Octave, version 2.9.4 (i686-pc-linux-gnu).
octave:1> help mkdir
mkdir is a built-in function

 -- Built-in Function: [STATUS, MSG, MSGID] = mkdir (DIR)
     Create a directory named DIR.

     If successful, STATUS is 1, with MSG and MSGID empty character
     strings.  Otherwise, STATUS is 0, MSG contains a system-dependent
     error message, and MSGID contains a unique message identifier.

================================================================



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]