Mail Archives: djgpp/1995/09/18/16:35:41
From: | Marc Singer <nbn.nbn.com!sapien!elf>
|
Subject: | mkdir return value EACCESS...
|
To: | nbn.nbn.com!sapien!sun.soe.clarkson.edu!djgpp (DJGPP List Alias)
|
Date: | Fri, 15 Sep 1995 14:49:42 -0700 (PDT)
|
Is this the correct return value when trying to create a directory
that exists? Linux returns EEXIST while DJGPP returns EACCESS. I
notice that DOS returns permission denied, too. Is this a limitation
of the error codes that DOS returns from system calls?
I wrote a simple little test routine to check this:
------------------------------------------------------------------------
#include <unistd.h> /* Comment this out for a DOS compiler */
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
main ()
{
char sz[80];
int result;
printf ("Directory to create:");
scanf ("%s", sz);
printf ("errno before %d (%s)\n", errno, sys_errlist [errno]);
result = mkdir (sz, 0777);
printf ("errno after %d (%s) with %d return\n", errno, sys_errlist [errno],
result);
exit (0);
}
------------------------------------------------------------------------
- Raw text -