반응형

dirent 4

Linux Shell 구현 소스

/* * http://sosal.tistory.com/ * made by so_Sal */ 유닉스 프로그래밍 수업에서 (비록 리눅스를 사용하지만)쉘 프로그래밍 과제가 나와, 했던 과제를 한번 올려 봅니다.- Linux shell programming 쉘(shell) 구현에서 간단한 시그널처리와 fore / back-ground 프로세싱 처리 등에 관하여 구현해보았습니다. * SIGNAL 기능. - ctrl + c : SIGINT - ctrl + z : SIGTSPT - wait 상태의 부모프로세스는 SIGCHLD로 다시 run. - rs (restart) : 자식을 SIGCONT signal로 stop 상태를 run으로, 부모는 restart된 자식을 다시 waitpid로 기다림 * lss : ls - ..

Linux/Linux_Source 2011.05.23

Linux - ps 프로세스 리스트 출력 프로그램 및 소스

/* * http://sosal.tistory.com/ * made by so_Sal */ 이 포스팅에서 다루는 내용 :: DIR *opendir(const char *dirname); :: int readdir(unsigned int fd, struct dirent *dirp, unsigned int count); :: struct dirent{}; :: int closedir(DIR *dir); :: int lstat(const char* path, struct stat* buf); :: struct stat{}; :: ==================예제================== #include #include DIR *opendir(const char *dirname); opendir() ..

Linux/Linux_Source 2010.01.26

Linux - dirent.h 함수와 구조체, find 프로그램 맛보기

/* * http://sosal.tistory.com/ * made by so_Sal */ 이번 포스팅에서 다루는 내용 :: DIR *opendir(const char *dirname); :: int readdir(unsigned int fd, struct dirent *dirp, unsigned int count); :: int getdents(unsigned int fd, struct dirent *dirp, unsigned int count); :: struct dirent :: int closedir(DIR *dir); #include #include DIR *opendir(const char *dirname); opendir() 함수는 매개변수 dirname에 해당하는 디렉토리 스트림을 열고, ..

Linux 간단한 ls 디렉토리 출력 프로그램 구현

/* * http://sosal.tistory.com/ * made by so_Sal */ LINK 2){ perror("Usage :: _ls [Directory] \n"); exit(EXIT_FAILURE); } char* position; position = argv[1]; // 메인함수는 디렉토리 목록을 출력할 위치를 _ls(position,0); // 인자로 받아 _ls 함수의 매개변수로 전달하는 일만 수행합니다. exit(0); } void _ls(char* pos,int depth){ //depth는 처음 0이고, 디렉토리 출력중 새로운 디렉토리를 만나면 //depth를 증가시켜 재귀적으로 함수를 다시 호출합니다. DIR *dp; // 실제 파일을 가리키는 포인터 struct dirent *..

Linux/Linux_Source 2009.11.01
반응형