Problem: Write a C/C++ program to create a folder in a specific directory path. This task can be accomplished by using the mkdir() function. Directories are created with this function. (There is also a shell command mkdir which does the same thing).
The mkdir function creates a new, empty directory with name filename . The argument mode specifies the file permissions for the new directory file.
The mkdir command by default gives rwx permissions for the current user only. To add read, write, and execute permission for all users, add the -m option with the user 777 when creating a directory. The directory with rwx permissions for all users is highlighted.
Answers. Hi Oju, Mkdir will create the directory in default directory path or current working directory path in which powershell window is open. mkdir - p creates the directory in the path mentioned by you explicitly.
I need to use the mkdir c++ function in VS 2008 which takes two arguments and is deprecated from VS 2005.
However this function is used in our code and I need to write a standalone product (containing only mkdir function) to debug something.
What header files do I need to import? I used direct.h, however compiler complains that the argument does not take 2 arguments (reason for this is the function was deprecated in VS 2005).
mkdir("C:\hello",0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With