Created
October 19, 2014 06:01
-
-
Save ericwomer/0307a66b21e8a4452a21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <sys/stat.h> | |
| #include <stdbool.h> | |
| #include <wchar.h> | |
| //bool CreateDirectory(const TCHAR* Directory) | |
| //{ | |
| // return mkdir(TCHAR_TO_UTF8(*NormalizeFilename(Directory)), 0755) == 0; | |
| //} | |
| typedef wchar_t TCHAR; | |
| bool CreateDirectory(const TCHAR* Directory) | |
| { | |
| return mkdir(*Directory, 0755) == 0; | |
| } | |
| int main(void) | |
| { | |
| const TCHAR TDirectory = "/home/salamanderrake/Documents/WithoutSpace"; | |
| const TCHAR TDirectory_With_Space = "/home/salamanderrake/Documents/With Space"; | |
| printf("Without spaces in directory path\n"); | |
| if(!CreateDirectory(&TDirectory)) | |
| { | |
| printf("CreatDirectory without spaces failed \n"); | |
| } | |
| printf("With spaces in directory path\n"); | |
| if(!CreateDirectory(&TDirectory_With_Space)) | |
| { | |
| printf("CreatDirectory with spaces failed \n"); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment