23 #if !defined (octave_file_stat_h)
24 #define octave_file_stat_h 1
30 #include <sys/types.h>
39 :
initialized (false), fail (false), errmsg (), fs_mode (),
40 fs_ino (), fs_dev (), fs_nlink (), fs_uid (), fs_gid (),
41 fs_size (), fs_atime (), fs_mtime (), fs_ctime (), fs_rdev (),
42 fs_blksize (), fs_blocks () { }
46 fs_mode (fs.fs_mode), fs_ino (fs.fs_ino), fs_dev (fs.fs_dev),
47 fs_nlink (fs.fs_nlink), fs_uid (fs.fs_uid), fs_gid (fs.fs_gid),
48 fs_size (fs.fs_size), fs_atime (fs.fs_atime), fs_mtime (fs.fs_mtime),
49 fs_ctime (fs.fs_ctime), fs_rdev (fs.fs_rdev),
50 fs_blksize (fs.fs_blksize), fs_blocks (fs.fs_blocks) { }
91 bool is_blk (
void)
const;
92 bool is_chr (
void)
const;
93 bool is_dir (
void)
const;
94 bool is_fifo (
void)
const;
95 bool is_lnk (
void)
const;
96 bool is_reg (
void)
const;
97 bool is_sock (
void)
const;
99 static bool is_blk (
mode_t mode);
100 static bool is_chr (
mode_t mode);
101 static bool is_dir (
mode_t mode);
102 static bool is_fifo (
mode_t mode);
103 static bool is_lnk (
mode_t mode);
104 static bool is_reg (
mode_t mode);
105 static bool is_sock (
mode_t mode);
107 ino_t
ino (
void)
const {
return fs_ino; }
108 dev_t
dev (
void)
const {
return fs_dev; }
110 nlink_t
nlink (
void)
const {
return fs_nlink; }
112 uid_t
uid (
void)
const {
return fs_uid; }
113 gid_t
gid (
void)
const {
return fs_gid; }
115 off_t
size (
void)
const {
return fs_size; }
121 dev_t
rdev (
void)
const {
return fs_rdev; }
123 long blksize (
void)
const {
return fs_blksize; }
124 long blocks (
void)
const {
return fs_blocks; }
128 std::string mode_as_string (
void)
const;
132 operator bool ()
const {
return ok (); }
134 bool exists (
void)
const {
return ok (); }
136 std::string
error (
void)
const {
return ok () ? std::string () : errmsg; }
143 static int is_newer (
const std::string&,
const octave_time&);
204 file_stat (
const std::string& n = std::string (),
bool fl =
true)
207 if (! file_name.empty ())
213 follow_links (fs.follow_links) { }
230 void get_stats (
bool force =
false)
233 update_internal (force);
236 void get_stats (
const std::string& n,
bool force =
false)
244 update_internal (force);
257 void update_internal (
bool force =
false);
288 void get_stats (
bool force =
false)
291 update_internal (force);
294 void get_stats (
int n,
bool force =
false)
302 update_internal (force);
311 void update_internal (
bool force =
false);