source: libcf/trunk/include/cf_file.h@ 94

Last change on this file since 94 was 94, checked in by cheese, 11 years ago

#1 change interface to get file size

File size: 1.2 KB
RevLine 
[4]1/**
[26]2 * @file cf_file.h
3 * @author myusgun <myusgun@gmail.com>
[34]4 *
[73]5 * @remarks 파일 I/O
6 *
[35]7 * @example file.c
[4]8 */
9#ifndef __CF_FILE_H__
10#define __CF_FILE_H__
11
12#include "cf_base.h"
13
[90]14#include <stddef.h>
15
[26]16/** 파일 열기 옵션 플래그 */
17typedef enum {
[90]18 CF_FILE_READ = 0x0001, /**< 읽기 전용 */
19 CF_FILE_WRITE = 0x0002, /**< 쓰기 전용 */
20 CF_FILE_RW = 0x0004, /**< 읽기/쓰기 */
21 CF_FILE_CREATE = 0x0008, /**< 파일이 존재하지 않으면 생성 */
22 CF_FILE_TRUNC = 0x0010, /**< 파일이 존재하면 비우기 */
23 CF_FILE_APPEND = 0x0020 /**< 파일이 존재하면 이어서 쓰기 */
[16]24} E_CF_FILE_FLAG, CF_FILE_FLAG;
[15]25
[4]26#ifdef __cplusplus
27extern "C" {
28#endif
29
30CF_EXPORT int
[16]31CF_File_Open (const char * path,
32 const CF_FILE_FLAG flag);
[4]33
34CF_EXPORT int
[35]35CF_File_Create (const char * path);
[4]36
37CF_EXPORT int
[35]38CF_File_Close (const int fd);
[4]39
40CF_EXPORT int
41CF_File_Read (const int fd,
42 void * buf,
43 const size_t len);
44
45CF_EXPORT int
46CF_File_Write (const int fd,
47 const void * buf,
48 const size_t len);
49
50CF_EXPORT int
[94]51CF_File_GetSize (const char * path);
[4]52
[41]53CF_EXPORT int
54CF_File_MakeDirectory (const char * path);
55
[4]56#ifdef __cplusplus
57}
58#endif
59
60#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.