[erlang-questions] differences in file:make_dir under Linux and

dj3vande <>
Thu May 14 16:57:58 CEST 2009


Somebody claiming to be Steve Davis wrote:
> 
> I don't have both platforms to compare (no mac). However, I would
> strongly suspect that the return value would depend on the POSIX
> return value from the underlying OS. Others here may know more/for
> sure.

That's consistent with observable behavior on systems I have access
to.

Linux:
--------
:~ (0) $ mkdir /
mkdir: cannot create directory `/': File exists
:~ (1) $
--------

Mac:
--------
:~ (0) $ mkdir /
mkdir: /: Is a directory
:~ (1) $
--------

SunOS:
--------
:~ (0) $ mkdir /
mkdir: /: File exists
:~ (1) $
--------

SUSv3's description of mkdir(2) specifies that it fails with EEXIST if
"the named file exists", and doesn't mention EISDIR.  So MacOS seems to
be the odd one based on what I have to play with.  BSD behavior
(particularly FreeBSD, which is Darwin's direct ancestor) may also be
interesting.


dave

-- 
Dave Vandervies


Plan your future!  Make God laugh!



More information about the erlang-questions mailing list