Is there a simple way to create a folder using C ?

  • Thread starter Thread starter Sky2004
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around programming questions related to Visual C++ and specifically focuses on creating a folder using the C programming language. The context includes both Windows and Unix environments.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • Yingtian asks if there is a simple way to create a folder using C, specifically on Windows XP.
  • Warren suggests using the mkdir function from the sys/stat.h header, but does not specify its compatibility with Windows.
  • Yingtian questions the applicability of the mkdir function on Windows, noting that it seems to be Unix-specific.
  • Warren asserts that mkdir exists on Windows as well, but does not provide further details.

Areas of Agreement / Disagreement

Participants have not reached a consensus regarding the compatibility of the mkdir function with Windows, as Yingtian expresses uncertainty while Warren asserts its existence.

Sky2004
Messages
2
Reaction score
0
Hi! :frown:
I have 2 programming questions here. Hope you could help me with it.

Q1) Is there a way to pre-specify the size and location of command prompt window that runs along with my application written using Visual C++ ? Be it using C or some batch command?

Q2) Is there a simple way to create a folder using C ?


Thank you,
Yingtian.
 
Computer science news on Phys.org
1) not that I'm aware of.

2) #include <sys/types.h>
#include <sys/stat.h>

int mkdir (const char *path, mode_t mode);

- Warren
 
Thanks for your reply!

For Q2), the mkdir u suggested seems to work only for unix? I forgot to say that I am using windows xp...so...is there an equivalent simple syntax for it?

Regards,
Yingtian.
 
I'm pretty sure mkdir exists on windows as well.

- Warren
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 24 ·
Replies
24
Views
11K
Replies
14
Views
4K
Replies
9
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
12K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
81
Views
8K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K