Changeset 26 in libcf for trunk/include/cf_file.h
- Timestamp:
- 02/04/13 17:00:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/cf_file.h
r17 r26 1 1 /** 2 * cf_file.h 2 * @file cf_file.h 3 * @author myusgun <myusgun@gmail.com> 4 * @version 0.1 3 5 */ 4 6 #ifndef __CF_FILE_H__ … … 16 18 #define CF_ERROR_FILE_GET_SIZE CF_ERROR_FILE - 7 17 19 18 typedef enum{ 19 CF_FILE_RO = O_RDONLY, 20 CF_FILE_WO = O_WRONLY, 21 CF_FILE_WR = O_RDWR, 22 CF_FILE_CR = O_CREAT, 23 CF_FILE_TR = O_TRUNC, 24 CF_FILE_AP = O_APPEND 20 /** 파일 열기 옵션 플래그 */ 21 typedef enum { 22 CF_FILE_RO = O_RDONLY, /**< 읽기 전용 */ 23 CF_FILE_WO = O_WRONLY, /**< 쓰기 전용 */ 24 CF_FILE_WR = O_RDWR, /**< 읽기/쓰기 */ 25 CF_FILE_CR = O_CREAT, /**< 파일이 존재하지 않으면 생성 */ 26 CF_FILE_TR = O_TRUNC, /**< 파일이 존재하면 비우기 */ 27 CF_FILE_AP = O_APPEND /**< 파일이 존재하면 이어서 쓰기 */ 25 28 } E_CF_FILE_FLAG, CF_FILE_FLAG; 26 29 … … 29 32 #endif 30 33 34 /** 35 * 파일 열기 36 * 37 * @return 성공 시, 파일 디스크립터; 실패 시, 오류 코드 38 * 39 * @param path 파일 경로 40 * @param flag 파일 열기 플래그 41 * 42 * @see CF_FILE_FLAG 43 */ 31 44 CF_EXPORT int 32 45 CF_File_Open (const char * path, 33 46 const CF_FILE_FLAG flag); 34 47 48 /** 49 * 파일 닫기 50 * 51 * @return 성공 시, CF_OK; 실패 시, 오류 코드 52 * 53 * @param fd 파일 디스크립터 54 */ 35 55 CF_EXPORT int 36 CF_File_Close (const int 56 CF_File_Close (const int fd); 37 57 58 /** 59 * 파일 생성 60 * 61 * @return 성공 시, 파일 디스크립터; 실패 시, 오류 코드 62 * 63 * @param path 파일 경로 64 */ 38 65 CF_EXPORT int 39 66 CF_File_Create (const char * path); 40 67 68 /** 69 * 파일 읽기 70 * 71 * @return 성공 시, 읽은 바이트 수; 실패 시, 오류 코드 72 * 73 * @param fd 파일 디스크립터 74 * @param buf 데이터를 저장할 메모리 75 * @param len 데이터를 저장할 메모리의 크기 76 */ 41 77 CF_EXPORT int 42 78 CF_File_Read (const int fd, … … 44 80 const size_t len); 45 81 82 /** 83 * 파일 쓰기 84 * 85 * @return 성공 시, CF_OK; 실패 시, 오류 코드 86 * 87 * @param fd 파일 디스크립터 88 * @param buf 데이터가 저장된 메모리 89 * @param len 쓸 데이터의 길이 90 */ 46 91 CF_EXPORT int 47 92 CF_File_Write (const int fd, … … 49 94 const size_t len); 50 95 96 /** 97 * 파일 크기 얻기 98 * 99 * @return 성공 시, 파일 크기; 실패 시, 오류 코드 100 * 101 * @param fd 파일 디스크립터 102 */ 51 103 CF_EXPORT int 52 104 CF_File_GetSize (const int fd);
Note:
See TracChangeset
for help on using the changeset viewer.