473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How to create a directory in C

Sorry for this boring noob question but I found a lot of answers via google for C++ and other languages but I need help with C


I want to create a directory if it doesn't exist.

Can I use mkdir in C? But is that compatible if someone ran my program on Windows cmd?

thanks
Jun 22 '11 #1
2 2183
weaknessforcats
9,208 Expert Mod 8TB
You can use mkdir in Windows but the slashes in the path lean the opposite way to Linux so you won't have portability anyway.

Call system() in C using mkdir as an argument. Review your documentaton for the arguments to system(). They vary between Linux and Windows.
Jun 22 '11 #2
johny10151981
1,059 1GB
If windows try using CreateDirectory

and make sure you are not using Turbo C
Jun 24 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ken Fine | last post by:
I want my application to maintain a directory tree based on months and years, e.g.: 2004 January file file file February file
2
by: Christian Pické | last post by:
Hi, I tried following code, but I get an execption "URI formats not supported" Directory.CreateDirectory(@http://www.test.com/shop/images); The path is not located on my own computers, but...
2
by: Paul Bromley | last post by:
How can I create a directory within a shared ntwork directory?? sServerName - is the Server name "\Docs" - is the shared directory "\Others" - is the directory to create. The following...
4
by: tomek | last post by:
hi i'm desperate... i'm trying this for 2 days now... so if anyone can help - please. i have upload form in which users can choose TYPE of file they are uploading (graphic/text/music) - and...
5
by: AmitGujrathi | last post by:
Hi all,,, can anybody pls tell me how to create directory on web server using C#.Net windows application thanks in Advance Amit
4
by: Robert | last post by:
Greetings New to Visual Studio 2008. Always us VB6.0 SP5. I am trying to copy files from A to B. I select a directory, and copy files. Works ok, but it does not create the directory first. ...
4
by: kathy30 | last post by:
I'm storing files in SQL and retrieving them when needed to the user's C: Drive This is accessed on our Intranet site, the problem is the create directory and saving files happens on the Server...
6
by: coolestavi007 | last post by:
Hi, I have to create directories on the FTP server. I have tried directory.exists but it doesnt work.Any other way to create directory on the server.Please help me.
1
by: printline | last post by:
Hello all I have a php script that uploads a file from a form into a directory. The directory is automatically created through the script. But the upload file is not put in to the directory,...
4
Frinavale
by: Frinavale | last post by:
I am not the greatest system administrator and I am having some problems with my current setup which has crippled my ability to continue my current Joomla project that I'm working on. I cannot...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.