Copy명령어 구현
- 최초 등록일
- 2011.03.17
- 최종 저작일
- 2010.10
- 7페이지/ 한컴오피스
- 가격 3,000원
소개글
Copy명령어를 쉘프롬프트상에서 돌려 시스템프로그래밍이라는과목에서 구현한 과제결과물입니다.
mycp함수는 인터넷에 찾아보면 많이나오니 본자료보다 인터넷을 활용해 보시기 바랍니다.
본 과제물에는 mycp소스코드와 실행을돌린후의 스크린샷을 담았습니다.
목차
없음
본문내용
/* mycp : 리눅스의 cp 명령어구현실습. 32071403 김보성 / sanupspy@nate.com */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
6 -
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#define MAX_BUF 64
int main(int argc, char *argv[])
{
struct stat temp; //권한체크를 위한 할당
int fd_o, fd_c; //FileDescripter_Original, FileDescripter_Clone
int read_size, write_size;
char buf[MAX_BUF];
if(argc != 3){ // 인자갯수를 잘못 받았을때
printf("사용법 : %s 생성할파일명 원본파일명 \n", argv[0]); // 에러검증 1
exit(-1);
}
이하생략
참고 자료
시스템프로그래밍 강의노트3 슬라이드자료(....)
http://www.joinc.co.kr/modules/moniwiki/wiki.php/man/2/stat - 리눅스시스템콜 stat in wiki.
http://kldp.org/node/4135 - stat에서 퍼미션알려면..? 에 달린 답글.