Behavior of 'mkdir'

John W. Eaton jwe at bevo.che.wisc.edu
Tue Jul 22 20:33:42 CDT 2008


On 22-Jul-2008, WMennerich wrote:

| 
| Hi,
| the behavior of octaves mkdir is not equal to Matlabs mkdir:
| 
| Octave:
| 
| mkdir(test)
| 
| ans=1
| 
| mkdir(test) %second call
| 
| ans=0
| 
| 
| ************
| 
| Matlab:
| mkdir(test)
| 
| ans=1
| 
| mkdir(test) %second call
| 
| ans=1
| Warning: Directory already exists.
| 
| **************************
| As I understand the difference is that octave tells you whether the
| directory was created or not:
| The second call does not create the directory because it is already
| existing.
| Hence, the ack is 'false'.
| Matlab tells you whether the directory exists  or not, so also the second
| result is 'true'.
| 
| Would it be better to implement the mkdir function like the Matlab one?

Sure, I'd consider a patch that improves compatibility in this case.

jwe


More information about the Octave-maintainers mailing list