[#BloombergLP-bdls-FilesystemUtil_UnixImpUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::FilesystemUtil_UnixImpUtil :relfileprefix: ../../ :mrdocs: Namespace for `FilesystemUtil` Unix implementation details. == Synopsis Declared in `<bdls_filesystemutil_uniximputil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class UNIX_INTERFACE> struct FilesystemUtil_UnixImpUtil; ---- == Description 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: * `UNIX_INTERFACE::off_t` is a type alias to the `off_t` type provided by the `sys/types.h` header. * `UNIX_INTERFACE::stat` is a type alias to the `stat` type provided by the `sys/stat.h` header. * `UNIX_INTERFACE::time_t` is a type alias to the `time_t` type provided by the `sys/types.h` header. * `UNIX_INTERFACE::get_st_mtim_nsec` is a public, static member function that has `long (const stat& stat)` type and whose contract is to return the value of the `st_mtim.tv_nsec` field of the specified `stat` struct. * `UNIX_INTERFACE::get_st_mtime` is a public, static member function that has `time_t (const stat& stat)` type and whose contract is to return the value of the `st_mtime` field of the specified `stat` struct. * `UNIX_INTERFACE::get_st_size` is a public, static member function that has `off_t (const stat& stat)` type and whose contract is to return the value of the `st_size` field of the specified `stat` struct. Note that this function is required in order to access the data members of a `stat` struct in a manner consistent with the requirements of `get_st_mtime`. * `UNIX_INTERFACE::fstat` is a public, static member function that has `int (int fildes, stat *buf)` type and whose contract is to return the result of `::fstat(fildes, buf)`, where `::fstat` is the function provided by the `sys/stat.h` header. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil_UnixImpUtil/FileDescriptor.adoc[`FileDescriptor`] | `FileDescriptor` is an alias for the operating system's native file descriptor / file handle type. | xref:BloombergLP/bdls/FilesystemUtil_UnixImpUtil/Offset.adoc[`Offset`] | `Offset` is an alias for a signed integral type, and represents the offset of a location in a file. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil_UnixImpUtil/getFileSize.adoc[`getFileSize`] | Return the size, in bytes, of the file with the specified `descriptor`, or a negative value if an error occurs. | xref:BloombergLP/bdls/FilesystemUtil_UnixImpUtil/getLastModificationTime.adoc[`getLastModificationTime`] | Load the file's last modification time into `time`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#