Unix to Windows Porting Dictionary for HPC

RSS

Links

Function List

open


Unix

header file: fcntl.h

int open(const char *filename, int oflag, ... );

Windows

header file: io.h

int _open( const char *filename, int oflag [, int pmode] );

Purpose

This function creates a new directory.

Discussion

The Windows _mkdir() function is almost identical to the POSIX mkdir(), with the exception that it does not require a parameter to specify the mode. Windows also provides the _wmkdir() function that has wide character support.

Example of Use in Windows

#include <direct.h>

int main(void)
{
   if( _mkdir( "\\testtmp" ) == 0 ) {
      printf("Directory '\\testtmp' was successfully created\n");
   }
   else
      printf("Problem creating directory '\\testtmp'\n");
}


  
blog comments powered by Disqus
Valid HTML 4.01 Transitional Valid CSS!