Notice
Recent Posts
Recent Comments
목록copy 1
LuvSea
Linux cp 명령어를 만들어보자.
여기서 Cmd[0]은 명령어, Cmd[1]은 복사할 대상파일, Cmd[2]는 복사 후 생성 파일 #include #include #include #include #include #include int main(int iNum, char * Cmd[3]) { char c; int in, out; if(3 != iNum) { printf("사용법 : 명령 원본 사본 \n"); return 0; } in = open(Cmd[1], O_RDONLY); // 파일 읽기 예외처리 if(-1 == in) { printf("%s파일이 없거나 사용법이 틀렸습니다!\n",Cmd[1]); return 0; } out = open(Cmd[2], O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); // 파일..
sTudy
2009. 4. 30. 17:43