2 // C++ Implementation: fileutils
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004
9 // Copyright: See COPYING file that comes with this distribution
17 #include "fileutils.h"
22 create_filename (char *name, char *ext)
26 filename = (char *) malloc (strlen (name) + strlen (ext) + 2);
27 /* 2 = 1 for the . and one for the '\0' */
30 fprintf (stderr, "Error in memory allocation! %s %d\n",
35 sprintf (filename, "%s.%s", name, ext);
41 open_fstream (const char *filename)
43 ofstream *fstream = new ofstream (filename);
47 fprintf( stderr, "Error creating %s\n", filename ) ;