26 #if defined (HAVE_CONFIG_H)
39 #if defined (OCTAVE_USE_WINDOWS_API)
161 return std::string (buf);
169 const sys::time&
time)
181 if (! m_file_name.empty ())
188 file_stat::update_internal (
bool force)
197 #if defined (OCTAVE_USE_WINDOWS_API)
198 full_file_name = sys::env::make_absolute (full_file_name);
201 while (full_file_name.length () > 1
203 full_file_name.pop_back ();
209 static const regexp pat (R
"(^\\\\[\w.-]+\\[\w\$-]+$)");
210 if ((full_file_name.length () == 2 && full_file_name[1] ==
':')
211 || (full_file_name.length () > 4 && full_file_name[0] ==
'\\'
212 && full_file_name[1] ==
'\\' && pat.is_match (full_file_name)))
213 full_file_name.push_back (
'\\');
216 const char *cname = full_file_name.c_str ();
218 time_t sys_atime, sys_mtime, sys_ctime;
224 &sys_atime, &sys_mtime, &sys_ctime,
228 &sys_atime, &sys_mtime, &sys_ctime,
238 m_atime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_atime));
239 m_mtime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_mtime));
240 m_ctime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_ctime));
248 file_fstat::update_internal (
bool force)
255 time_t sys_atime, sys_mtime, sys_ctime;
260 &sys_atime, &sys_mtime, &sys_ctime,
270 m_atime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_atime));
271 m_mtime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_mtime));
272 m_ctime = sys::time (
static_cast<OCTAVE_TIME_T
> (sys_ctime));
279 OCTAVE_END_NAMESPACE(sys)
280 OCTAVE_END_NAMESPACE(
octave)
bool is_newer(const sys::time &time) const
static bool have_struct_stat_st_blocks()
static bool have_struct_stat_st_blksize()
std::string mode_as_string() const
static bool have_struct_stat_st_rdev()
file_stat(const std::string &n="", bool fl=true)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string tilde_expand(const std::string &name)
bool octave_is_lnk_wrapper(mode_t mode)
bool octave_is_chr_wrapper(mode_t mode)
bool octave_is_fifo_wrapper(mode_t mode)
bool octave_have_struct_stat_st_rdev(void)
bool octave_have_struct_stat_st_blocks(void)
int octave_fstat_wrapper(int fid, mode_t *mode, ino_t *ino, dev_t *dev, nlink_t *nlink, uid_t *uid, gid_t *gid, off_t *size, time_t *atime, time_t *mtime, time_t *ctime, dev_t *rdev, long *blksize, long *blocks)
bool octave_is_blk_wrapper(mode_t mode)
bool octave_is_dir_wrapper(mode_t mode)
bool octave_is_reg_wrapper(mode_t mode)
int octave_lstat_wrapper(const char *lname, mode_t *mode, ino_t *ino, dev_t *dev, nlink_t *nlink, uid_t *uid, gid_t *gid, off_t *size, time_t *atime, time_t *mtime, time_t *ctime, dev_t *rdev, long *blksize, long *blocks)
bool octave_is_sock_wrapper(mode_t mode)
int octave_stat_wrapper(const char *fname, mode_t *mode, ino_t *ino, dev_t *dev, nlink_t *nlink, uid_t *uid, gid_t *gid, off_t *size, time_t *atime, time_t *mtime, time_t *ctime, dev_t *rdev, long *blksize, long *blocks)
bool octave_have_struct_stat_st_blksize(void)
void octave_strmode_wrapper(mode_t mode, char *buffer)