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

dj3vande@REDACTED dj3vande@REDACTED
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

dj3vande@REDACTED:~ (0) $ mkdir /
mkdir: cannot create directory `/': File exists
dj3vande@REDACTED:~ (1) $

dj3vande@REDACTED:~ (0) $ mkdir /
mkdir: /: Is a directory
dj3vande@REDACTED:~ (1) $

dj3vande@REDACTED:~ (0) $ mkdir /
mkdir: /: File exists
dj3vande@REDACTED:~ (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


Dave Vandervies

Plan your future!  Make God laugh!

More information about the erlang-questions mailing list