한땀한땀 정성들인 코딩
저수준 파일입출력 함수 본문
반응형
#include <io.h>
#include <fcntl.h>
int _open(const char *filename, int oflag); //성공 fd리턴
int _close(int fd); //성공 0리턴
_O_BINARY -바이너리
_O_TEXT -텍스트
_O_RDONLY -읽기전용
_O_WRONLY -쓰기전용
_O_RDWR -읽기기
_O_APPEND -커서를 맨끝으로
_O_CREAT -새로파일 생성
_O_SHORT_LIVE -임시파일
_O_TEMPORARY -close할때 파일 삭제
oflag값은 |로 여러개 줄수 있다.
입출력함수
int _read(int fd,void *buf,unsigned int count); //count만큼 버퍼로 읽음
int _write(int fd,const void *buf,unsigned int count); //count만큼 버퍼로 씀
성공시 count리턴
임의접근
long _lseek(int fd,long offset,int origin);
long _tell(int fd);
반응형
'메모' 카테고리의 다른 글
리틀엔디안,빅엔디안 : 복습 (0) | 2017.01.12 |
---|---|
파일 검색/관리 함수 (0) | 2017.01.12 |
파일 임의접근 (0) | 2017.01.12 |
스트림(sream) (0) | 2017.01.12 |
바이너리파일 입출력 (0) | 2017.01.11 |