windows下建立目錄

#include <windows.h>
#include <stdio.h>
int make_dir( char * p_path )
{
int result = 0;
DWORD last_error = 0;
result = CreateDirectory(p_path, NULL); 
if ( result == 0)
{
last_error = GetLastError(); 
if ( last_error == ERROR_ALREADY_EXISTS)
{
result = 1;
}
}
return result;
}
相關文章
相關標籤/搜索