// // C++ Implementation: osutils // // Description: // // // Author: smidl , (C) 2008 // // Copyright: See COPYING file that comes with this distribution // // #include "osutils.h" #include #ifdef WIN32 #include #else #include #include #endif #include #include void get_fname ( char* filename, string &dirname, string &f ) { #ifdef WIN32 sprintf ( filename,"%s\\%s",dirname.c_str(),f.c_str() ); #else sprintf ( filename,"%s/%s",dirname.c_str() ,f.c_str() ); #endif } void makedir(string &dirname, bool rewrite){ #ifdef WIN32 if (mkdir(dirname.c_str()) == -1) // Create the directory #else if (mkdir(dirname.c_str(), 00755) == -1) // Create the directory #endif { if ((rewrite) && ( errno==EEXIST ) ) it_warning ( "rewriting directory" ); else it_error ( "dirfilelog:: cannot create directory" ); } }