2-2. 유닉스 파일 시스템콜 : open, creat, close, read, write, lseek , dup, fcntl
open(2) 괄호 안에 (2)라고 있는 건 시스템콜을 의미함 1은 command, 2는 system call, 3은 library를 의미함 #include int open(const char *pathname, int flags, [mode_t mode]); Returns: file descriptor if OK, -1 on error open 시스템콜을 사용하기 위해서는 /usr/include/fcntl.h 헤더파일을 반드시 include 해야함 첫번째 인자로는 relative 또는 absolute pathname이 들어감 char*는 문자열임 세번째 인자는 옵션임 두번째 인자 flag는 read only, wrtie only, read write 이런 내용이 들어감 보통 바이너리 값으로 되어 있음 ..