[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


mkdir

Makes a folder.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <stat.h>
int mkdir(const char *path, int mode); /* Mac */
int mkdir(const char *path); /* Windows */
Parameters:

Parameters for this facility are:

path  
const char *  
The path name  
mode  
int  
The open mode   (Not applicable for Windows)  

Remarks:

This function creates the new folder specified in path. It ignores the argument mode.

Return:

If it is successful, mkdir() returns zero. If it encounters an error, mkdir() returns -1 and sets errno.

See Also:

"unlink"

"rmdir"

Example for mkdir():
Macintosh 

#include <stdio.h> #include <stat.h> int main(void) { if( mkdir(":Akbar", 0) == 0) printf("Folder Akbar is created"); return 0; }
Windows 

#include <stdio.h> #include <stat.h> int main(void) { if( mkdir(".\Akbar") == 0) printf("Folder Akbar is created"); return 0; }
Creates a folder named Akbar as a sub-folder of the current folder


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000