cynapses libc file functions
[cynapses libc API (internal)]


Defines

#define BUFFER_SIZE   (16 * 1024)

Functions

int c_compare_file (const char *f1, const char *f2)
int c_copy (const char *src, const char *dst, mode_t mode)
int c_isfile (const char *path)
int c_rename (const char *src, const char *dst)


Define Documentation

#define BUFFER_SIZE   (16 * 1024)

Definition at line 40 of file c_file.h.


Function Documentation

int c_compare_file ( const char *  f1,
const char *  f2 
)

Compare the content of two files byte by byte.

Parameters:
f1 Path of file 1
f2 Path of file 2
Returns:
0 if the files differ, 1 if the files are equal or -1 on error with errno set.

int c_copy ( const char *  src,
const char *  dst,
mode_t  mode 
)

copy a file from source to destination.

Parameters:
src Path to the source file
dst Path to the destination file
mode File creation mode of the destination. If mode is 0 then the mode from the source will be used.
Returns:
0 on success, less then 0 on error with errno set. EISDIR if src or dst is a file.

int c_isfile ( const char *  path  ) 

Check if a path is a regular file or a link.

Parameters:
path The path to check.
Returns:
1 if the path is a file, 0 if the path doesn't exist, is a something else or can't be accessed.

int c_rename ( const char *  src,
const char *  dst 
)

move a file from source to destination.

Parameters:
src Path to the source file
dst Path to the destination file
Returns:
0 on success, less than 0 on error with errno set.


Generated on Mon Oct 21 19:24:18 2013 for doc by  doxygen 1.5.6