23 #if ! defined (octave_file_stat_h) 24 #define octave_file_stat_h 1 26 #include "octave-config.h" 32 #include <sys/types.h> 46 m_ino (), m_dev (), m_nlink (), m_uid (), m_gid (),
47 m_size (), m_atime (), m_mtime (), m_ctime (), m_rdev (),
48 m_blksize (), m_blocks () { }
52 m_mode (
fs.m_mode), m_ino (
fs.m_ino), m_dev (
fs.m_dev),
53 m_nlink (
fs.m_nlink), m_uid (
fs.m_uid), m_gid (
fs.m_gid),
54 m_size (
fs.m_size), m_atime (
fs.m_atime), m_mtime (
fs.m_mtime),
55 m_ctime (
fs.m_ctime), m_rdev (
fs.m_rdev),
56 m_blksize (
fs.m_blksize), m_blocks (
fs.m_blocks) { }
97 bool is_blk (
void)
const;
98 bool is_chr (
void)
const;
99 bool is_dir (
void)
const;
100 bool is_fifo (
void)
const;
101 bool is_lnk (
void)
const;
102 bool is_reg (
void)
const;
103 bool is_sock (
void)
const;
105 static bool is_blk (mode_t
mode);
106 static bool is_chr (mode_t
mode);
107 static bool is_dir (mode_t
mode);
108 static bool is_fifo (mode_t
mode);
109 static bool is_lnk (mode_t
mode);
110 static bool is_reg (mode_t
mode);
111 static bool is_sock (mode_t
mode);
113 static bool have_struct_stat_st_rdev (
void);
114 static bool have_struct_stat_st_blksize (
void);
115 static bool have_struct_stat_st_blocks (
void);
117 ino_t
ino (
void)
const {
return m_ino; }
118 dev_t
dev (
void)
const {
return m_dev; }
120 nlink_t
nlink (
void)
const {
return m_nlink; }
122 uid_t
uid (
void)
const {
return m_uid; }
123 gid_t
gid (
void)
const {
return m_gid; }
125 off_t
size (
void)
const {
return m_size; }
131 dev_t
rdev (
void)
const {
return m_rdev; }
133 long blksize (
void)
const {
return m_blksize; }
134 long blocks (
void)
const {
return m_blocks; }
136 mode_t
mode (
void)
const {
return m_mode; }
142 operator bool ()
const {
return ok (); }
144 bool exists (
void)
const {
return ok (); }
220 follow_links (
fs.follow_links) { }
242 update_internal (force);
253 update_internal (force);
266 void update_internal (
bool force =
false);
300 update_internal (force);
311 update_internal (force);
320 void update_internal (
bool force =
false);
325 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 327 OCTAVE_DEPRECATED (4.2,
"use 'octave::sys::base_file_stat' instead")
328 typedef
octave::sys::base_file_stat base_file_stat;
330 OCTAVE_DEPRECATED (4.2, "use '
octave::sys::file_stat'
instead")
331 typedef
octave::sys::file_stat file_stat;
333 OCTAVE_DEPRECATED (4.2, "use '
octave::sys::file_fstat'
instead")
334 typedef
octave::sys::file_fstat file_fstat;
std::string error(void) const
base_file_stat & operator=(const base_file_stat &fs)
void get_stats(const std::string &n, bool force=false)
sys::time time_resolution(void) const
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
sys::time ctime(void) const
file_fstat(const file_fstat &fs)
sys::time atime(void) const
void get_stats(bool force=false)
file_stat(const file_stat &fs)
base_file_stat(const base_file_stat &fs)
void get_stats(int n, bool force=false)
octave::sys::file_stat fs(filename)
nlink_t nlink(void) const
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
sys::time mtime(void) const
bool is_newer(const sys::time &time) const
void get_stats(bool force=false)