Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |
Tags
- 2941
- 시스템 프로그래밍
- File 조작
- Parenthesis
- 균형잡힌 세상
- LJESNJAK
- 시프
- 10773
- 4949
- 전자책
- For Beginners
- QA
- c++
- IT
- file IO
- 해바
- 1874
- 입력 버퍼
- Process Communication
- 브런치
- c
- Baekjoon
- 5622
- 백준
- process control
- BAKA
- 바샤
- system programming
- The Balance of the World
- Zero That Out
Archives
- Today
- Total
목록File 조작 (2)
해바
다음과 같은 프로그램을 작성하라 : 인자로서 디렉토리 이름과 파일의 접미사(suffix)를 읽어 들인다. 주어진 디렉토리를 탐색하여 이름에 인자로 주어진 접미사가 포함된 첫번째 파일을 찾아 그 파일의 i-node 값과 파일 이름을 출력한다. 주어진 파일이름(*s1)이 접미사 (*s2)를 포함하는지 check 해 주는 함수 int match(char* s1, char* s2)를 활용할 것 int match(char* s1, char* s2) { int diff = strlen(s1) - strlen(s2); if(strlen(s1) > strlen(s2)) return (strcmp(&s1[diff], s2) == 0); else return 0; } #include #include #include #in..
System Programming
2019. 11. 16. 23:10
Lab #5
link()와 unlink 시스템 호출을 사용하여 파일의 이름을 바꾸는 Linux의 mv 커맨드를 구현할 것 자기 홈 디렉토리에 lab5 디렉토리를 만든 후 프로그램 파일(mv.c)을 보관할 것 #include #include #include int main(int argc, char* argv[]) { link(argv[1], argv[2]); unlink(argv[1]); close(*argv[1]); return 0; } 컴파일 : %gcc mv.c -o mv.out 실행 : %./mv.out afile bfile
System Programming
2019. 11. 16. 21:32