Quick Links:

bal | bbl | bdl | bsl

Public Types | Static Public Member Functions

bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE > Struct Template Reference

#include <bdls_filesystemutil_uniximputil.h>

List of all members.

Public Types

typedef int FileDescriptor
typedef UNIX_INTERFACE::off_t Offset

Static Public Member Functions

static Offset getFileSize (FileDescriptor descriptor)
static int getLastModificationTime (bdlt::Datetime *time, FileDescriptor descriptor)

Detailed Description

template<class UNIX_INTERFACE>
struct bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE >

This component-private utility struct provides a namespace for a suite of functions that FilesystemUtil uses as implementation details. These functions have a UNIX_INTERFACE template parameter, which provides access to the entities that large-file environment Unix systems declare, and that the function implementations need.

Note that, on some Unix platforms and some build configurations, the stat struct does not have an st_mtime field, and st_mtime is a macro that emulates the access of the field. Similarly, on some Unix platforms and some build configurations, the stat structure does not have an st_mtim field or the st_mtim struct does not have a tv_nsec (or, for some versions of Solaris, __tv_nsec) field, in which case the get_st_mtim_nsec function returns zero. For more information, please see the specification of the sys/stat.h header from IEEE Std 1003.1-2017, which provides information about the evolution of the stat struct in the POSIX specification (https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/).

The program is ill-formed unless the specified UNIX_INTERFACE is a class type that meets the following requirements:

See Component bdls_filesystemutil_uniximputil


Member Typedef Documentation

template<class UNIX_INTERFACE >
typedef int bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE >::FileDescriptor
template<class UNIX_INTERFACE >
typedef UNIX_INTERFACE::off_t bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE >::Offset

Member Function Documentation

template<class UNIX_INTERFACE >
static Offset bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE >::getFileSize ( FileDescriptor  descriptor  )  [static]

Return the size, in bytes, of the file with the specified descriptor, or a negative value if an error occurs.

template<class UNIX_INTERFACE >
static int bdls::FilesystemUtil_UnixImpUtil< UNIX_INTERFACE >::getLastModificationTime ( bdlt::Datetime time,
FileDescriptor  descriptor 
) [static]

Load into the specified time the last modification time of the file with the specified descriptor, as reported by the filesystem. Return 0 on success, and a non-zero value otherwise. Note that the time is reported in UTC.


The documentation for this struct was generated from the following file: