Hi All,
I have the following code which will create a directory with path(dirname) and attributes. Even though Parent directory exists at the time of calling this function, this function fails in Leopard(On both 10.5 & 10.5.1) and working fine in Tiger.
FPRESULT MakeADirectory(char *dirname, PF_FileAttributes *attrs) { FPRESULT i = FP_ERR_SYSERR; char cmd[PATH_MAX+20]; int res; res = mkdir(dirname, UnixIDType2ID(attrs->mode) & 0777); if (res == 0) { if (UnixIDType2ID(attrs->owner) || UnixIDType2ID(attrs->group)) res=chown(dirname, UnixIDType2ID(attrs->owner), UnixIDType2ID(attrs->group)); if (res != 0) i = FP_ERR_BADFILE; else i = 0; } else { if (errno==ENOENT) i = FP_ERR_NOENT; if (errno == EEXIST) i=0; } return i; }
I have tried it by replacing mkdir call with system(), but no luck.
Is there any modifications required to support leopard?
Thanks, - Apparao.
|