ccnfilewatch.c File Reference

Utility program to record a file's size. More...

Go to the source code of this file.

Defines

#define FW_NBUF   4
 Monitor the size of the named file, recording its growth.

Functions

static int usage (const char *progname)
static int statchanged (struct stat *prev, struct stat *curr)
static void printstat (FILE *out, struct stat *s)
int ccn_filewatch (const char *path, FILE *out, off_t minsize, off_t maxsize, time_t maxsec, int msecstable, int msecpoll)
int main (int argc, char **argv)


Detailed Description

Utility program to record a file's size.

Definition in file ccnfilewatch.c.


Define Documentation

#define FW_NBUF   4

Monitor the size of the named file, recording its growth.

This is used for repository tests. We want to measure the point at which the repository file is a stable size.

Parameters:
path is the name of the file to monitor
out is where to write the logged data
minsize is the minimum expected final size
maxsize is threshold beyond which we stop monitoring
maxsec is a limit, in seconds, on how long to monitor
msecstable is a time in milliseconds to consider file size stable
msecpoll is the delay, in milliseconds, between polls.
Returns:
0 if stability was obtained within given parameters, -1 if system call failed or invaild arguments (see errno), -2 if maxsize exceeded, -3 if maxsec exceeded, -4 if the file is unlinked.

Definition at line 95 of file ccnfilewatch.c.

Referenced by ccn_filewatch().


Function Documentation

int ccn_filewatch ( const char *  path,
FILE *  out,
off_t  minsize,
off_t  maxsize,
time_t  maxsec,
int  msecstable,
int  msecpoll 
)

Definition at line 97 of file ccnfilewatch.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 176 of file ccnfilewatch.c.

static void printstat ( FILE *  out,
struct stat *  s 
) [static]

Definition at line 52 of file ccnfilewatch.c.

Referenced by ccn_filewatch().

static int statchanged ( struct stat *  prev,
struct stat *  curr 
) [static]

Definition at line 42 of file ccnfilewatch.c.

Referenced by ccn_filewatch().

static int usage ( const char *  progname  )  [static]

Definition at line 36 of file ccnfilewatch.c.


Generated on Thu Feb 16 00:44:09 2012 for Content-Centric Networking in C by  doxygen 1.5.6