Computing.Net > Forums > Programming > make folder with C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

make folder with C

Reply to Message Icon

Name: Wiliam
Date: January 11, 2002 at 09:54:59 Pacific
Comment:

how can i make a folder with c language.
I try this code but didn't work.
#include
#include
main()
{
char *command = "mkdir test";

system(command);

return 0;
}
but unfortunately no folder was found.
plz help me.
I'm using CodeWarrior, win 2000 pro
thanks



Sponsored Link
Ads by Google

Response Number 1
Name: atom
Date: January 11, 2002 at 16:20:41 Pacific
Reply:

look at the documentation for mkdir... that function will create directorys


0

Response Number 2
Name: Giuseppe
Date: January 12, 2002 at 01:57:53 Pacific
Reply:

Perhaps the problem isn't in your code but in the Operative System you're using. When you call void system(char *command); C (or C++) lets OS to execute char *command. So if you do not use Dos (or Windows) probably your code will not work. You have only to replace "mkdir" with the command to create a forlder of your OS. The command must be the one you type on command line to create a folder. I've tryed your code on Windows 98 and it works.

Let me know when you solve the problem.

Bye


0

Response Number 3
Name: Wiliam
Date: January 12, 2002 at 08:13:17 Pacific
Reply:

hello;
I'm using win 2000 pro and the compiler is CodeWarrior. but i have no result yet
I included the stdio.h and stdlib.h
no resulllllllllllllllllllllllt.
plz help.


0

Response Number 4
Name: helge
Date: January 13, 2002 at 04:53:44 Pacific
Reply:

cygwin is a unix environment
available free for windows.
Look at sources.redhat.com
and select cygwin and download
the setup.exe file and
follow the instruction.
The your first C program
will work without the
windows struggles.
Else install any Linux distributions
such as redhat, debian, slackware or
mandrake...
(type www..org,
ie www.mandrake.org)
Then you have full development environment
without the windows struggles!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Permisson per application VB & ADO's



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: make folder with C

make folder with C language www.computing.net/answers/programming/make-folder-with-c-language/488.html

Making and deleting folders in C++ www.computing.net/answers/programming/making-and-deleting-folders-in-c/3490.html

Opening Folders with C++ www.computing.net/answers/programming/opening-folders-with-c/828.html