Java Mailing List Archive

http://www.redhatconfig.com/

Home » Gentoo Linux »

Re: [gentoo-user] [OT] mkdir in a C program?

Francisco Rivas

2008-04-04

Replies:

Author LoginPost Reply
I found this :

#include<sys/stat.h>

int main(int argc,char **argv){
if (argc < 2) exit(1);
mkdir(argv[1],0777);
return 0;
}
http://gd.tuwien.ac.at/languages/c/programming-dmarshall/node20.html

I hope that can help you :D

On Sat, Apr 5, 2008 at 10:27 AM, Denis <denis.che@gmail.com> wrote:
Does anyone know if a directory can be created from inside a C program
and how that is done?  Suppose I run the code from my own directory
/home/mydir, and I want the code to create a directory
/home/mydir/mydata, where data is to be written, what would the format
for such a command be?  Also, when you write files to
/home/mydir/mydata, do i put in something like "./mydata/filename" as
the filename to open/write?

Many thanks!
Denis
--
gentoo-user@lists.gentoo.org mailing list




--
Francisco Rivas
http://www.vaslibre.org.ve
-
And on the seventh day God said :wq and then make
http://beck3r.wordpress.com/
Linux User (New) : #448324
Linux Machine (New) : 355187
---
4to Congreso Nacional de SL
http://www.cnsl.org.ve/tiki-index.php?page=carabobo
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.