8#ifndef INCLUDED_BDLS_FILESYSTEMUTIL_UNIXIMPUTIL
9#define INCLUDED_BDLS_FILESYSTEMUTIL_UNIXIMPUTIL
58#include <bdlt_datetime.h>
117template <
class UNIX_INTERFACE>
128 typedef typename UNIX_INTERFACE::off_t
Offset;
137 typedef typename UNIX_INTERFACE::off_t off_t;
141 typedef typename UNIX_INTERFACE::stat stat;
146 typedef typename UNIX_INTERFACE::time_t time_t;
152 static long get_st_mtim_nsec(
const stat& stat);
156 static time_t get_st_mtime(
const stat& stat);
162 static off_t get_st_size(
const stat& stat);
167 static int fstat(
int fildes, stat *buf);
193template <
class UNIX_INTERFACE>
197 return UNIX_INTERFACE::get_st_mtim_nsec(stat);
200template <
class UNIX_INTERFACE>
201typename UNIX_INTERFACE::time_t
202FilesystemUtil_UnixImpUtil<UNIX_INTERFACE>::get_st_mtime(
const stat& stat)
204 return UNIX_INTERFACE::get_st_mtime(stat);
207template <
class UNIX_INTERFACE>
208typename UNIX_INTERFACE::off_t
209FilesystemUtil_UnixImpUtil<UNIX_INTERFACE>::get_st_size(
const stat& stat)
211 return UNIX_INTERFACE::get_st_size(stat);
214template <
class UNIX_INTERFACE>
215int FilesystemUtil_UnixImpUtil<UNIX_INTERFACE>::fstat(
int fildes, stat *buf)
217 return UNIX_INTERFACE::fstat(fildes, buf);
221template <
class UNIX_INTERFACE>
227 const int rc = fstat(descriptor, &statResult);
232 return get_st_size(statResult);
235template <
class UNIX_INTERFACE>
241 int rc = fstat(descriptor, &statResult);
252 long nanoseconds = get_st_mtim_nsec(statResult);
Definition bdlt_datetime.h:331
int addMicrosecondsIfValid(bsls::Types::Int64 microseconds)
Definition bdlt_datetime.h:2103
int addSecondsIfValid(bsls::Types::Int64 seconds)
Definition bdlt_datetime.h:2040
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdls_fdstreambuf.h:412
Definition bdls_filesystemutil_uniximputil.h:118
static Offset getFileSize(FileDescriptor descriptor)
Definition bdls_filesystemutil_uniximputil.h:223
UNIX_INTERFACE::off_t Offset
Definition bdls_filesystemutil_uniximputil.h:128
static int getLastModificationTime(bdlt::Datetime *time, FileDescriptor descriptor)
Definition bdls_filesystemutil_uniximputil.h:236
int FileDescriptor
Definition bdls_filesystemutil_uniximputil.h:124
static const Datetime & epoch()
Definition bdlt_epochutil.h:375
static const bsls::Types::Int64 k_NANOSECONDS_PER_SECOND
Definition bdlt_timeunitratio.h:217
static const int k_NANOSECONDS_PER_MICROSECOND_32
Definition bdlt_timeunitratio.h:296