[Beowulf] Stupid MPI programming question
Joe Landman
landman at scalableinformatics.com
Wed Sep 27 21:15:34 PDT 2006
Clements, Brent M (SAIC) wrote:
> Ok, here is the code I'm working with....mkdir keeps giving me a -1
> failure...can anyone spot what I"m doing wrong?
>
Trust in the man page Luke ... er Brent... (and use
#include <errno.h>
extern int errno;
in your code.
Then you can do an
if (mkdir_return == -1)
{
if (errno == EPERM) { printf("Its a permission error!\n"); }
if (errno == EEXIST) { printf("Its already existed!\n"); }
if (errno == EACESS) { printf("Parent directory wont let me!\n"); }
...
}
From the man page ...
RETURN VALUE
mkdir returns zero on success, or -1 if an error occurred (in
which
case, errno is set appropriately).
ERRORS
EPERM The filesystem containing pathname does not support the
cre-
ation of directories.
EEXIST pathname already exists (not necessarily as a directory).
This
includes the case where pathname is a symbolic link,
dangling
or not.
EFAULT pathname points outside your accessible address space.
EACCES The parent directory does not allow write permission
to the
process, or one of the directories in pathname did not
allow
search (execute) permission.
ENAMETOOLONG
pathname was too long.
ENOENT A directory component in pathname does not exist or is a
dan-
gling symbolic link.
ENOTDIR
A component used as a directory in pathname is not, in
fact, a
directory.
ENOMEM Insufficient kernel memory was available.
EROFS pathname refers to a file on a read-only filesystem.
ELOOP Too many symbolic links were encountered in resolving
pathname.
ENOSPC The device containing pathname has no room for the new
direc-
tory.
ENOSPC The new directory cannot be created because the
user's disk
quota is exhausted.
--
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: landman at scalableinformatics.com
web : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax : +1 734 786 8452 or +1 866 888 3112
cell : +1 734 612 4615
More information about the Beowulf
mailing list