Gentoo Archives: gentoo-user

From: Francisco Rivas <taken2k4@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] mkdir in a C program?
Date: Fri, 04 Apr 2008 15:10:58
Message-Id: 2fcf3fa50804040810g111e8369v69e62f0427b94534@mail.gmail.com
In Reply to: [gentoo-user] [OT] mkdir in a C program? by Denis
1 I found this :
2
3 #include<sys/stat.h>
4
5 int main(int argc,char **argv){
6 if (argc < 2) exit(1);
7 mkdir(argv[1],0777);
8 return 0;
9 }
10 http://gd.tuwien.ac.at/languages/c/programming-dmarshall/node20.html
11
12 I hope that can help you :D
13
14 On Sat, Apr 5, 2008 at 10:27 AM, Denis <denis.che@×××××.com> wrote:
15
16 > Does anyone know if a directory can be created from inside a C program
17 > and how that is done? Suppose I run the code from my own directory
18 > /home/mydir, and I want the code to create a directory
19 > /home/mydir/mydata, where data is to be written, what would the format
20 > for such a command be? Also, when you write files to
21 > /home/mydir/mydata, do i put in something like "./mydata/filename" as
22 > the filename to open/write?
23 >
24 > Many thanks!
25 > Denis
26 > --
27 > gentoo-user@l.g.o mailing list
28 >
29 >
30
31
32 --
33 Francisco Rivas
34 http://www.vaslibre.org.ve
35 -
36 And on the seventh day God said :wq and then make
37 http://beck3r.wordpress.com/
38 Linux User (New) : #448324
39 Linux Machine (New) : 355187
40 ---
41 4to Congreso Nacional de SL
42 http://www.cnsl.org.ve/tiki-index.php?page=carabobo