Hey, what is the code to create a file in a different directory than the one the C program is in? Say the program is in c:\x\yy, and I want the program to create a text file in c:\x\zz\top.
Printable View
Hey, what is the code to create a file in a different directory than the one the C program is in? Say the program is in c:\x\yy, and I want the program to create a text file in c:\x\zz\top.
fopen("full/path/to/dir/filename", "w");
or
fopen("full\\path\\to\\dir\\filename", "w");
Or
Or some other implementation dependent way of specifying file structure paths. C doesn't care as long as the path eventually resolves to something valid.Code:fopen ( "full:path:to:dir:filename", "w" );
Prelude.
Which filesystem/OS uses colons as a separator?
Macintosh before they began to use Darwin as the environment behind OS X.
Cool. Yeah I was just informed that on IRC too.
What was the equivalent of ../ then? ..:?
>What was the equivalent of ../ then?
Clicking on the up arrow? :)