From 0107a75be6e54225218abd3083b119b200791be9 Mon Sep 17 00:00:00 2001 From: Gerd v. Egidy Date: Fri, 27 Aug 2004 12:08:11 +0000 Subject: [PATCH] libi2ncommon, arnied: (gerd) don't run check_everything if /var/intranator/no_check is existing --- src/filefunc.cpp | 10 ++++++++++ src/filefunc.hxx | 2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/filefunc.cpp b/src/filefunc.cpp index adc61ec..6804af7 100644 --- a/src/filefunc.cpp +++ b/src/filefunc.cpp @@ -19,6 +19,16 @@ using namespace std; +bool file_exists (const string &name) +{ + struct stat statbuff; + + if (stat(name.c_str(), &statbuff) < 0) + return false; + else + return true; +} + long fsize (const string &name) { long iReturn = -1; diff --git a/src/filefunc.hxx b/src/filefunc.hxx index 0486613..a4af02c 100644 --- a/src/filefunc.hxx +++ b/src/filefunc.hxx @@ -7,6 +7,8 @@ #ifndef __FILEFUNC_HXX #define __FILEFUNC_HXX +bool file_exists (const std::string &name); + long fsize (const std::string &name); std::string load_file (const std::string &name); -- 1.7.1