libi2ncommon, arnied: (gerd) don't run check_everything if /var/intranator/no_check...
authorGerd v. Egidy <gerd.von.egidy@intra2net.com>
Fri, 27 Aug 2004 12:08:11 +0000 (12:08 +0000)
committerGerd v. Egidy <gerd.von.egidy@intra2net.com>
Fri, 27 Aug 2004 12:08:11 +0000 (12:08 +0000)
src/filefunc.cpp
src/filefunc.hxx

index adc61ec..6804af7 100644 (file)
 
 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;
index 0486613..a4af02c 100644 (file)
@@ -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);