Coda Distributed File System
Macros | Functions
copyfile.h File Reference
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdint.h>
Include dependency graph for copyfile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BUF_SIZE   8192 /* size of buffer for looping copy */
 

Functions

int copyfile_seg (int infd, int outfd, uint64_t pos, int64_t count)
 
int copyfile (int fromfd, int tofd)
 
int copyfile_byname (const char *fromname, const char *toname)
 

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   8192 /* size of buffer for looping copy */

Function Documentation

◆ copyfile()

int copyfile ( int  fromfd,
int  tofd 
)

Copy a file to another file

Parameters
fromfdfile descriptor of the source file
tofdfile descriptor of the destination file
Returns
-1 on errors and 0 otherwise

◆ copyfile_byname()

int copyfile_byname ( const char *  fromname,
const char *  toname 
)

Copy a file to another file

Parameters
fromnamefile path of the source file
tonamefile path of the destination file
Returns
-1 on errors and 0 otherwise

◆ copyfile_seg()

int copyfile_seg ( int  infd,
int  outfd,
uint64_t  pos,
int64_t  count 
)

Copy a segment of a file to another file

Parameters
infdfile descriptor of the source file
outfdfile descriptor of the destination file
posoffset within the source file
countamount of bytes to be copied
Returns
-1 on errors and 0 otherwise