Changeset 34 in libcf for trunk/include/cf_file.h
- Timestamp:
- 02/05/13 11:26:59 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/cf_file.h
r26 r34 3 3 * @author myusgun <myusgun@gmail.com> 4 4 * @version 0.1 5 * 6 * @section 샘플코드 7 * @code 8 9 #include "cf_file.h" 10 11 int main (void) { 12 int fd = 0; 13 char *name = "file.txt"; 14 char buffer[128] = {0x00,}; 15 16 fd = CF_File_Create (name); 17 if (fd < 0) { 18 // error 19 } 20 if (CF_File_Write (fd, "file test", 9) < 0) { 21 // error 22 } 23 CF_File_Close (fd); 24 25 fd = CF_File_Open (name, CF_FILE_RO); 26 if (fd < 0) { 27 // error 28 } 29 printf ("file size : %d\n", CF_File_GetSize (fd)); 30 if (CF_File_Read (fd, buffer, sizeof (buffer)) < 0) { 31 // error 32 } 33 CF_File_Close (fd); 34 35 return 0; 36 } 37 38 * @endcode 5 39 */ 6 40 #ifndef __CF_FILE_H__
Note:
See TracChangeset
for help on using the changeset viewer.