cfs/src/perfutil/Util.cc
/**
 * Read all bytes in a file and return it as a buffer. The caller is
 * responsible for calling delete[] on the return value.
 *
 * Limitation: This function only handles ASCII files, and does not correctly
 * read files containing NULL characters.
 */
Read all bytes in a file and return it as a buffer. The caller is
responsible for calling delete[] on the return value.

This function only handles ASCII files, and does not correctly
read files containing NULL characters.
Read all bytes in a file and return it as a buffer . The caller is responsible for calling delete [] on the return value . This function only handles ASCII files and does not correctly read files containing NULL characters .
char*
fileGetContents(const char* filename) {
  FILE* f = fopen(filename, "r");
  char* output = fileGetContents(f);
  fclose(f);
  return output;
}
char * fileGetContents ( const char * filename ) { FILE * f = fopen ( filename , " " ) ; char * output = fileGetContents ( f ) ; fclose ( f ) ; return output ; }
Read all bytes in a file and return it as a buffer.
Read all bytes in a file and return it as a buffer .