FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-04-2008, 02:57 PM
Denis
 
Default mkdir in a C program?

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
 
Old 04-04-2008, 03:06 PM
Ale
 
Default mkdir in a C program?

2008/4/4, Denis <denis.che@gmail.com>:
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

Take a look on system function, for example system("mkdir /home/mydir");

Cheers!


--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-04-2008, 03:10 PM
"Francisco Rivas"
 
Default mkdir in a C program?

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

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
 
Old 04-04-2008, 03:20 PM
Denis
 
Default mkdir in a C program?

Thank you for all the quick replies! That answers my question :-)
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-04-2008, 03:22 PM
"Francisco Rivas"
 
Default mkdir in a C program?

Good. Wich one you used?


On Sat, Apr 5, 2008 at 10:50 AM, Denis <denis.che@gmail.com> wrote:

Thank you for all the quick replies! *That answers my question :-)

--

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
 

Thread Tools




All times are GMT. The time now is 12:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org