8 #define DOS_PATH_CHAR '\\'
9 #define UNIX_PATH_CHAR '/'
11 #if defined (__DJGPP__) || defined (__WIN32__)
13 #define PATH_CHAR '\\'
14 #define PATH_CHAR_STR "\\"
18 #define PATH_CHAR_STR "/"
21 void ConvertPathCharacters(char *Path
)
28 if (Path
[i
] == DOS_PATH_CHAR
|| Path
[i
] == UNIX_PATH_CHAR
)
37 int MakeDirectory(char *Directory
)
39 char CurrentDirectory
[1024];
41 getcwd(CurrentDirectory
, 1024);
43 if (chdir(Directory
) == 0)
45 chdir(CurrentDirectory
);
49 #if defined (UNIX_PATHS) || defined (__DJGPP__)
50 if (mkdir(Directory
, 0755) != 0)
52 perror("Failed to create directory");
56 if (mkdir(Directory
) != 0)
58 perror("Failed to create directory");
63 if (chdir(Directory
) != 0)
65 perror("Failed to change directory");
69 chdir(CurrentDirectory
);
74 int main(int argc
, char* argv
[])
78 fprintf(stderr
, "Wrong number of arguments\n");
82 ConvertPathCharacters(argv
[1]);
84 return MakeDirectory(argv
[1]);