00001 #include "utils.h"
00002 #include <fstream>
00003
00004
00005
00006
00007 bool file_exists( const char* file_name ){
00008 std::ifstream file;
00009 file.open(file_name,std::ios::in);
00010 bool result;
00011 if (file.fail()) result = false;
00012 else result = true;
00013 file.close();
00014 return result;
00015 }
00016
00017 bool file_exists( const std::string& file_name ){
00018 return file_exists( file_name.c_str() );
00019 }
00020
00021 double mod(double x, double y){
00022 return x-int(x/y)*y;
00023 }