PPL Logo

libs/ck-libs/metis/GKlib/fs.c File Reference

Various file-system functions. More...

Go to the source code of this file.

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 10711 2011-08-31 22:23:04Z karypis $ 

Definition in file fs.c.


Function Documentation

int gk_fexists ( char *  fname  ) 

Definition at line 21 of file fs.c.

Referenced by gk_csr_Read(), gk_graph_Read(), parse_cmdline(), ReadGraph(), ReadMesh(), and ReadTPwgts().

Here is the caller graph for this function:

int gk_dexists ( char *  dirname  ) 

Definition at line 35 of file fs.c.

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).

Definition at line 55 of file fs.c.

Referenced by gk_dreadfilebin(), gk_freadfilebin(), gk_i32readfilebin(), and gk_i64readfilebin().

Here is the caller graph for this function:

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:
fname is the name of the file
r_nlines is the number of lines in the file. If it is NULL, this information is not returned.
r_ntokens is the number of tokens in the file. If it is NULL, this information is not returned.
r_max_nlntokens is the maximum number of tokens in any line in the file. If it is NULL this information is not returned.
r_nbytes is the number of bytes in the file. If it is NULL, this information is not returned.

Definition at line 79 of file fs.c.

References gk_fclose(), and gk_fopen().

Referenced by gk_csr_Read(), gk_i32readfile(), gk_i64readfile(), gk_readfile(), gk_seq_ReadGKMODPSSM(), and ReadMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

char* gk_getbasename ( char *  path  ) 

Definition at line 135 of file fs.c.

References gk_strdup().

Referenced by gk_seq_ReadGKMODPSSM().

Here is the call graph for this function:

Here is the caller graph for this function:

char* gk_getextname ( char *  path  ) 

Definition at line 159 of file fs.c.

References gk_strdup().

Here is the call graph for this function:

char* gk_getfilename ( char *  path  ) 

Definition at line 173 of file fs.c.

References gk_strdup().

Here is the call graph for this function:

char* getpathname ( char *  path  ) 

Definition at line 188 of file fs.c.

References gk_strdup().

Here is the call graph for this function:

int gk_mkpath ( char *  pathname  ) 

Definition at line 207 of file fs.c.

int gk_rmpath ( char *  pathname  ) 

Definition at line 219 of file fs.c.


Generated on Mon Sep 21 08:08:02 2020 for Charm++ by  doxygen 1.5.5