Group: linux.gentoo.user
From: "Francisco Rivas"
Date: Friday, April 04, 2008 10:20 AM
Subject: Re: [gentoo-user] [OT] mkdir in a C program?

------=_Part_5594_9276785.1207321855982
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I found this :

#include

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 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

------=_Part_5594_9276785.1207321855982
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_5594_9276785.1207321855982--
--
gentoo-user@lists.gentoo.org mailing list

Safety Articles | Usenet Groups | Usenet News | Bluegrass