[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Behavior of 'mkdir'
From: |
WMennerich |
Subject: |
Re: Behavior of 'mkdir' |
Date: |
Thu, 24 Jul 2008 09:31:55 -0700 (PDT) |
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
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'.
Second:
Yes, you may be right, one can not conclude that programmers using 'mkdir'
have
more background than others: This conclusion came from my own experience:
With my first matlab programms, I was happy that it runs somehow, but I was
far away from playing
with directories and stuff like that, e.g user inputs, loading and writing
data, ....
;-)
Wolfgang
--
View this message in context:
http://www.nabble.com/Behavior-of-%27mkdir%27-tp18587943p18635652.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.
- Behavior of 'mkdir', WMennerich, 2008/07/22
- Behavior of 'mkdir', John W. Eaton, 2008/07/22
- Re: Behavior of 'mkdir', WMennerich, 2008/07/23
- Re: Behavior of 'mkdir', John W. Eaton, 2008/07/23
- Re: Behavior of 'mkdir', Jaroslav Hajek, 2008/07/23
- Re: Behavior of 'mkdir', John W. Eaton, 2008/07/23
- Re: Behavior of 'mkdir', Jaroslav Hajek, 2008/07/23
- Re: Behavior of 'mkdir', John W. Eaton, 2008/07/23
- Re: Behavior of 'mkdir', WMennerich, 2008/07/24
- Re: Behavior of 'mkdir', John W. Eaton, 2008/07/24
- Re: Behavior of 'mkdir',
WMennerich <=
- Re: Behavior of 'mkdir', Shai Ayal, 2008/07/24
- Re: Behavior of 'mkdir', John W. Eaton, 2008/07/24