hp2FEM  0.1
Functions
src/metis-5.0/GKlib/fs.c File Reference

Various file-system functions. More...

#include <GKlib.h>
Include dependency graph for fs.c:

Functions

int gk_fexists (char *fname)
int gk_dexists (char *dirname)
intmax_t gk_getfsize (char *filename)
 Returns the size of the file in bytes.
void gk_getfilestats (char *fname, size_t *r_nlines, size_t *r_ntokens, size_t *r_max_nlntokens, size_t *r_nbytes)
char * gk_getbasename (char *path)
char * gk_getextname (char *path)
char * gk_getfilename (char *path)
char * getpathname (char *path)
int gk_mkpath (char *pathname)
int gk_rmpath (char *pathname)

Detailed Description

Various file-system functions.

This file contains various functions that deal with interfacing with the filesystem in a portable way.

Date:
Started 4/10/95
Author:
George
Version:
$Id: fs.c 9856 2011-04-30 17:52:43Z karypis $ 

Function Documentation

void gk_getfilestats ( char *  fname,
size_t *  r_nlines,
size_t *  r_ntokens,
size_t *  r_max_nlntokens,
size_t *  r_nbytes 
)

This function gets some basic statistics about the file.

Parameters:
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.
r_ntokensis the number of tokens in the file. If it is NULL, this information is not returned.
r_max_nlntokensis the maximum number of tokens in any line in the file. If it is NULL this information is not returned.
r_nbytesis the number of bytes in the file. If it is NULL, this information is not returned.
intmax_t gk_getfsize ( char *  filename)

Returns the size of the file in bytes.

This function returns the size of a file as a 64 bit integer. If there were any errors in stat'ing the file, -1 is returned.

Note:
That due to the -1 return code, the maximum file size is limited to 63 bits (which I guess is okay for now).
 All Classes Files Functions Variables Typedefs Friends Defines