octave-maintainers
[Top][All Lists]
Advanced

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

Re: Behavior of 'mkdir'


From: Shai Ayal
Subject: Re: Behavior of 'mkdir'
Date: Thu, 24 Jul 2008 19:57:11 +0300



On Thu, Jul 24, 2008 at 7:31 PM, WMennerich <address@hidden> wrote:

First:

This (simple) solution should work in both environments:

>
>[ack msg]=mkdir('testDirectory')
>
>if ~ack
>    if strcmp(msg,'File exists')
>        % 'Wrong alert'  by octave, -->do nothing
>    else
>        % some other thing is wrong, e.g. throw an errror here.
>    end
>end

Maybe you can submit a patch like this to the mkdir documentation?
 

But another thing which could increase the Octave/Matlab compatiblility:

The message string of the mkdir-function differs in the discussed case:

Matlab wrotes: 'Directory already exists.' (also with the point at the end)

Octave wrotes: 'File exists'


I would suggest to fit the message string given back by the octave mkdir to
the output which comes from matlab to make strcmp-constructs more compatible
between Matlab and Octave. Also because 'File exists' may be
misleading: Sure, in UnixU/Linux everything is a 'file', also directories.
But since
the name of this function is 'mkdir' and not 'mkfile' or something else, the
message should have a relation to 'directory'

So can you submit a patch?

 Shai


reply via email to

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