예제 #1
0
  FileInfo::FileInfo(const std::string &dirpath, const std::string &my_filename) : filename_("")
  {
    static std::string SLASH("/");

    if (!dirpath.empty()) {
      filename_ = dirpath;
      if (filename_.at(filename_.size() - 1) != '/') {
        filename_ += SLASH;
      }
    }
    filename_ += my_filename;
    readable_ = internal_access(filename_, R_OK);
    exists_   = readable_ || internal_access(filename_, F_OK);
  }
예제 #2
0
 FileInfo::FileInfo(const char *my_filename)
     : filename_(std::string(my_filename)), exists_(false), readable_(false)
 {
   readable_ = internal_access(filename_, R_OK);
   exists_   = readable_ || internal_access(filename_, F_OK);
 }
예제 #3
0
 //: Sets the filename
 void FileInfo::set_filename(const char *name)
 {
   filename_ = std::string(name);
   readable_ = internal_access(filename_, R_OK);
   exists_   = readable_ || internal_access(filename_, F_OK);
 }
예제 #4
0
 //: Returns TRUE if the file is executable
 bool FileInfo::is_executable() const { return internal_access(filename_, X_OK); }
예제 #5
0
 //: Returns TRUE if the file is writable
 bool FileInfo::is_writable() const { return internal_access(filename_, W_OK); }
예제 #6
0
파일: FileInfo.C 프로젝트: ChaliZhg/moose
FileInfo::FileInfo(const std::string &my_filename)
  : filename_(my_filename), exists_(false), readable_(false)
{
  exists_   = internal_access(filename_, F_OK);
  readable_ = internal_access(filename_, R_OK);
}
예제 #7
0
파일: FileInfo.C 프로젝트: ChaliZhg/moose
//: Sets the filename
void FileInfo::set_filename(const std::string &name)
{
  filename_ = name;
  exists_   = internal_access(filename_, F_OK);
  readable_ = internal_access(filename_, R_OK);
}