| Cyberwarfare (112) | |
|
Hey i am wondering, How i can create a Raw Folder in c++. But i do not how to do this so any one here please tell me. | |
|
Last edited on
|
|
| soranz (472) | |||
This is 1 way...
| |||
|
Last edited on
|
|||
| toum (170) | |
|
There is no standard way to do that. You have to use OS's specific code. For example, if you're using windows, you can use the function CreateDirectory() located in windows.h | |
|
|
|
| andywestken (1950) | |||
|
There is Boost.Filesystem, if you want a cross-platform solution Filesystem Library http://www.boost.org/doc/libs/1_51_0/libs/filesystem/doc/index.htm There's both boost::filesystem::create_directory, which can only create a single directory at a time (like mkdir, or _mkdir for newer versions of VC++, and CreateDirectory/CreateDirectoryEx), and boost::filesystem::create_directories which can handle multiple nested subdirectories, too.
| |||
|
|
|||
| Jackson Marie (462) | |
Can I use :system("mkdir \"c:/myfolder\"");:) | |
|
|
|
| ajh32 (85) | |
No you can't use:system("mkdir ...); mkdir is a UNIX command I thought you were using Windows? If you are using Windows, I suggest you investigate the CreateDirectory API, see WinBase.h HTH | |
|
|
|
| Jackson Marie (462) | ||
This is not correct. This is the same version of the function "CreateProcess" - Command name and parameters... (I've discovered typing "cmd" will certainly solve this problem. :)) So I can write (Another example) : system("cmd /c tskill explorer");Still works correctly. :) | ||
|
|
||
| ajh32 (85) | |
| I stand corrected. It's been years since I used MS DOS, I am more used to UNIX command line now. But, it would be more advisable to use the Windows API's. | |
|
|
|
| andywestken (1950) | ||
The Windows command console supports (ever since the initial version of Windows NT, version 3.1, which begat Windows 2000, Windows XP, etc.) mkdir, too. And the equivalent md command. Same deal with chdir (cd) and rmdir (rd). Windows-centric people tend to use the shorter form when writing batch files (do md, cd, rd exist in Linux?). Andy | ||
|
Last edited on
|
||