Changeset 151 in libcf for trunk/test/file.c


Ignore:
Timestamp:
10/31/13 10:17:24 (11 years ago)
Author:
cheese
Message:

#1 fix interface and add util module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/file.c

    r94 r151  
    66#include <stdio.h>
    77
    8 int main (void) {
    9     int fd = 0;
     8int main (void)
     9{
     10    cf_ctx fd = 0;
     11    int result = 0;
    1012    char *dir1 = "./dir1/test";
    1113    char *dir2 = "dir2/test";
     
    2123    }
    2224
    23     fd = CF_File_Create (name);
    24     if (fd < 0) {
     25    result = CF_File_Open (&fd, name, CF_FILE_CREATE|CF_FILE_RW|CF_FILE_TRUNC);
     26    if (result < 0) {
    2527        // error
    2628    }
     
    3032    CF_File_Close (fd);
    3133
    32     fd = CF_File_Open (name, CF_FILE_READ);
    33     if (fd < 0) {
     34    result = CF_File_Open (&fd, name, CF_FILE_READ);
     35    if (result < 0) {
    3436        // error
    3537    }
Note: See TracChangeset for help on using the changeset viewer.