29 #include <sys/types.h>
36 class DirectoryIteratorImp ;
43 if( ::stat( m_path.
str().c_str() , &statbuf ) )
47 else if( !(statbuf.st_mode & S_IFDIR) )
53 DIR * p = ::opendir( m_path.
str().c_str() ) ;
60 if( rc && for_creation )
63 if( 0 != ::access( m_path.
str().c_str() , W_OK ) )
71 std::ostringstream ss ;
79 if( tmp_filename.empty() ) tmp_filename = tmp() ;
82 int fd = ::open( test_file.
str().c_str() , O_WRONLY | O_CREAT | O_EXCL , S_IRWXU ) ;
88 bool ok = 0 == ::unlink( test_file.
str().c_str() ) ;
std::string str() const
Returns the path string.
static EpochTime now()
Returns the current epoch time.
bool valid(bool for_creating_files=false) const
Returns true if the object represents a valid directory.
bool writeable(std::string probe_filename=tmp()) const
Tries to create and then delete an empty test file in the directory.
static std::string tmp()
A convenience function for constructing a filename for writeable().
void pathAppend(const std::string &tail)
Appends a filename to the path.
A Path object represents a file system path.