로딩
요청 처리 중입니다...

파일 및 폴더 삭제하기

 파일 및 폴더 삭제하기

#c언어 파일 폴더 삭제하기 c언어는 파일의 존재 유무를 알아 보기 위한 access()함수와 파일 또는 폴더를 제거하기 위한 remove()함수를 제공합니다. 특정 파일 또는 폴더가 존재하는지 검사한 후 파일 또는 폴더가 존재할 때,각각을 삭제하는 것에 대하여 알아 봅니다.

#include #include #define EXIST 0 void main(void) { char *path; path = "c:\\test.txt"; if(access(path,EXIST) == EXIST) { if(remove(path) == 0) { printf("%s 파일이 삭제되었습니다. \n", path); } } else { printf("%s 파일이 존재하지 않습니다.

\n",path); } path = "c:\\temp"; if(access(path, EXIST) == EXIST) { if(remove(path) == 0) { printf("%s 폴더가 삭제되었...

# c # c언어 # c언어함수 # c프로그램 # 출력입력복사 # 파일폴더삭제하기 # 프로그램