|
-
June 11th, 2008, 06:10 PM
#16
Re: how to create directory in c++
 Originally Posted by bhas_purk
i had to create directories in windows using VC++
I can get CreateDirectory to work only when the path is like " c:/face"
If I give "c:/face/images" it doesnt create the folder, not even face, any help would be appreciated.
if I have c:/face created then it creates ./image also :?
You'll need to iteratively create enclosed folders: first c:/face, then c:/face/images.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
July 9th, 2008, 06:14 AM
#17
Re: how to create directory in c++
CreateDirectory() can only be used to create the final directory, if one or more intermediate directories do not exist, CreateDirectory() will fail with an error 3.
You may use SHCreateDirectoryEx() indeed, this fuction will generate a folder and its sub folders.
-
July 9th, 2008, 07:09 AM
#18
Re: how to create directory in c++
The thread that won't die.
-
January 7th, 2009, 11:22 AM
#19
Re: how to create directory in c++
lol, it never will
Last edited by l034n; January 7th, 2009 at 11:26 AM.
-
August 28th, 2010, 07:37 PM
#20
Re: how to create directory in c++
I know this is an old thread but this solution will work in both Windows and Linux.
char sysText[256];
sprintf( systext, "mkdir %s", path ); // path is a char * to the string representing the directory you want to create
system( systext );
-
August 29th, 2010, 04:11 PM
#21
Re: how to create directory in c++
 Originally Posted by whittenrob
Code:
char sysText[256];
sprintf( systext, "mkdir %s", path ); // path is a char * to the string representing the directory you want to create
system( systext );
Why that complicated? As already has been posted in this thread (long time ago), the C++ runtime has a mkdir() function on both *nix and Windows.
-
October 5th, 2010, 04:32 PM
#22
Re: how to create directory in c++
I am having some difficult times with this too.
my code in MS Visual C++ 6.0 looks like
char dirname[FILENAME_MAX] = {"c:\\new_directory\\"};
int erc;
erc = mkdir(dirname);
so far it works fine.
.....................................
I am trying to do the same thing using MS Visual C++ 2010 Express
the same set of instructions are not accepted, is there something I should add/change?
thanks in advance
-
October 5th, 2010, 04:40 PM
#23
Re: how to create directory in c++
-
October 5th, 2010, 05:36 PM
#24
Re: how to create directory in c++
I got back this
'_mkdir': identifier not found
could you please help me with the include file name, maybe it has changed ....
-
October 5th, 2010, 06:17 PM
#25
Re: how to create directory in c++
-
August 1st, 2011, 04:46 AM
#26
Re: how to create directory in c++
You can create directory in windows by using dis code ...................... jst pass da name of folder using char array
#include<iostream>
using namespace std;
void main()
{
system("mkdir D:foldername");
}
-
August 1st, 2011, 07:01 AM
#27
Re: how to create directory in c++
 Originally Posted by [email protected]
You can create directory in windows by using dis code ...................... jst pass da name of folder using char array
#include<iostream>
using namespace std;
void main()
{
system("mkdir D:foldername");
}
-
August 4th, 2011, 03:56 AM
#28
Re: how to create directory in c++
 Originally Posted by GCDEF
 Originally Posted by [email protected]
You can create directory in windows by using dis code ...................... jst pass da name of folder using char array
#include<iostream>
using namespace std;
void main()
{
system("mkdir D:foldername");
}

Well, [email protected] seems to be not a reader, he/she is a writer!
Victor Nijegorodov
-
August 18th, 2011, 04:06 PM
#29
Re: how to create directory in c++
 Originally Posted by VictorN
i m reader too
i m nt a linux user
and btw system("dos comands");
alows u to copy , move , and delete dir even so it a wide way open to use MS-DOS comands
-
August 18th, 2011, 04:09 PM
#30
Re: how to create directory in c++
 Originally Posted by exsan
I got back this
'_mkdir': identifier not found
could you please help me with the include file name, maybe it has changed ....
its works like
void main (){
system("mkdir C:\\folder name");
}
u can pass folder name wid char array
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|