C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

creating directories...?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Patrik
Guest





PostPosted: Tue Jun 29, 2004 2:02 pm    Post subject: creating directories...? Reply with quote



I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

Rgs,

Patrik
Back to top
Sharad Kala
Guest





PostPosted: Tue Jun 29, 2004 2:24 pm    Post subject: Re: creating directories...? Reply with quote




"Patrik" <pbohlin (AT) cadence (DOT) com> wrote

Quote:
I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

You need to resort to some platform specific API, standard C++ does not
define it.



Back to top
Dario (drinking coffee i
Guest





PostPosted: Tue Jun 29, 2004 2:31 pm    Post subject: Re: creating directories...? Reply with quote



Patrik wrote:

Quote:
I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

In any Posix environment:
#include <unistd.h>
//int mkdir(const char *pathname, mode_t mode);

- Dario

Back to top
osmium
Guest





PostPosted: Tue Jun 29, 2004 2:40 pm    Post subject: Re: creating directories...? Reply with quote

Patrik writes:

Quote:
I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

Using system() will give your program pretty much the same powers as a human
would have WRT the operating system. There may be a better way too,
included as part of the API.



Back to top
Victor Bazarov
Guest





PostPosted: Tue Jun 29, 2004 3:47 pm    Post subject: Re: creating directories...? Reply with quote

Patrik wrote:
Quote:
I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

There is no OS-independent way because not all OSes have directories.
You should consult your OS programming manual (or book). In most
cases a simple

system("mkdir /home/work/outfiles");

should do it, but what specifically to put in double quotes and what
the effect of that is going to be, is OS-specific.

V

Back to top
Prateek R Karandikar
Guest





PostPosted: Tue Jun 29, 2004 7:09 pm    Post subject: Re: creating directories...? Reply with quote

[email]pbohlin (AT) cadence (DOT) com[/email] (Patrik) wrote in message news:<40e55bca.0406290602.589c33d7 (AT) posting (DOT) google.com>...
Quote:
I know how to read/write files using iostram, but I can't figure out
how to create a directory. Say I wan't to create a directory called
"/home/work/outfiles", how do I do that? I'm running red hat linux.

Rgs,

Patrik

"directory" ??? No such thing exists in Standard C++.

-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.