43 #include <sys/types.h>
47 #include "HDFStructure.h"
52 explicit Stat(
const char *filename) {
53 _badstat = (stat(filename, &_sbuf) != 0);
57 explicit Stat(
const string & filename):_filename(filename) {
58 _badstat = (stat(filename.c_str(), &_sbuf) != 0);
79 nlink_t nlink()
const {
80 return _sbuf.st_nlink;
96 time_t atime()
const {
97 return _sbuf.st_atime;
100 time_t mtime()
const {
101 return _sbuf.st_mtime;
104 time_t ctime()
const {
105 return _sbuf.st_ctime;
108 long blksize()
const {
109 return _sbuf.st_blksize;
112 long blocks()
const {
113 return _sbuf.st_blocks;
120 const char *filename()
const {
121 return _filename.c_str();
124 bool operator!()
const {
134 inline string basename(
const string & path)
140 if (path.find(
"#") != string::npos)
141 return path.substr(path.find_last_of(
"#") + 1);
143 return path.substr(path.find_last_of(
"/") + 1);