반응형 디렉토리 생성1 디렉토리 관련 함수 #include #include #include int main() { char dir[256]; int ret = 0; FILE *fp; ret = chdir("C:\\test"); // test라는 디렉토리가 있으면 0, 없으면 -1을 리턴함. if(ret == -1) // test라는 디렉토리가 없을경우 mkdir("C:\\test"); // test 디렉토리 생성 else { // test라는 디렉토리가 있을경우 chdir("C:\\test"); // test 디렉토리로 이동 fp = fopen("test.txt","wt"); // test.txt파일 open if(fp){ fprintf(fp,"This is a test file."); fclose(fp); } } return 0; } 폴더가 있.. 2007. 4. 9. 이전 1 다음 반응형