[PLUG] how to adjust for special characters in mkdir() function?

logical american website.reader3 at gmail.com
Sat Oct 2 02:02:23 UTC 2010


> What arguments are you passing to mkdir()?  Do all elements of the
> path leading up to the new directory name exist?  The following
> program works for me.
>
>
> #include<sys/stat.h>
> #include<sys/types.h>
>
> main()
> {
>           mkdir("/tmp/foo bar-baz", 0777);
> }
>
Galen:

Try to make a directory with two depths, mkdir("/tmp/deeper/foo bar-baz 
bam", 0777); and see if that fails.  I have been playing around with the 
directory depth and my program fails with two slash characters in the path.

Randall




More information about the PLUG mailing list