Changeset 360


Ignore:
Timestamp:
Aug 4, 2005, 9:41:02 PM (18 years ago)
Author:
Jari Häkkinen
Message:

Added function to check file existence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility/FileIO.h

    r303 r360  
    55
    66#include <string>
     7
     8#include <unistd.h>
    79
    810namespace theplu {
     
    3234    int access_rights(const std::string& path,const std::string& bits) const;
    3335
     36    ///
     37    /// Check whether \a file exists.
     38    ///
     39    /// @return True if \a file exists, false otherwise.
     40    ///
     41    /// @see access(2)
     42    ///
     43    inline bool file_exists(const std::string& file) const
     44      { return !access(file.c_str(),F_OK); }
    3445  };
    3546
Note: See TracChangeset for help on using the changeset viewer.