Origin of file seek operations.
start =SEEK_SETcurrent =SEEK_CURend =SEEK_ENDdata =SEEK_DATAhole =SEEK_HOLEoperator=(file_descriptor_view &&) -> file_descriptor_view &file_descriptor_view(file_descriptor_view &&)operator=(const file_descriptor_view &) -> file_descriptor_view &file_descriptor_view(const file_descriptor_view &)~file_descriptor_view()file_descriptor_view()is_socket() const -> boolget() const -> fd_typefile_descriptor_view(fd_type fd)explicitFile descriptor wrapper.
attributes() const -> file_attributesremove_attribute(c_string name) -> voidattribute(c_string name, const_string value, file_attribute_flags f1 = file_attribute_flags{}) -> voidattribute(c_string name) const -> std::stringcall(operation op) -> voidtemplate <class T> call(operation op, T & argument) -> voidstatus() const -> file_statusGet file status for this file descriptor.
open(const char * filename, open_flag flags = open_flag(), mode_type mode = 0) -> void
Init file descriptor by opening file filename with open flags flags and mode mode.
validate() -> voidCheck if this file descriptor exists in the kernel by trying to get its flags.
swap(fildes & rhs) -> void
Swap with rhs.
operator!() const -> boolReturns true, if file descriptor is invalid.
operator bool() constexplicitReturns true, if file descriptor is valid.
operator!=(const fildes & rhs) const -> boolCompare file descriptors.
operator==(const fildes & rhs) const -> boolCompare file descriptors.
pipe_buffer_size(int new_size) -> intGet pipe buffer size.
pipe_buffer_size() const -> intGet pipe buffer size.
unsetf(fd_flag rhs) -> voidUnset file descriptor flags.
setf(fd_flag rhs) -> voidSet file descriptor flags.
unsetf(pipe_flag rhs) -> voidUnset file descriptor pipe flags.
setf(pipe_flag rhs) -> voidSet file descriptor pipe flags.
unsetf(open_flag rhs) -> voidUnset file descriptor open flags.
setf(open_flag rhs) -> voidSet file descriptor open flags.
fd_flags() const -> fd_flagGet file descriptor flags.
flags() const -> open_flagGet file descriptor open flags.
get() const -> fd_typeGet bare file descriptor.
fd() const -> fd_typeGet bare file descriptor.
sync_file_system() -> voidWrite file system cache to disk.
sync_data() -> voidWrite file data (but not metadata) from system memory to the disk.
sync() -> voidWrite file data and metadata from system memory to the disk.
truncate(offset_type length) -> voidSet file size in bytes.
offset(offset_type nbytes, seek_origin origin) -> offset_typeSet the current file offset in bytes starting from the specified origin.
offset(offset_type rhs) -> offset_typeSet the current file offset in bytes.
offset() const -> offset_typeGet the current file offset in bytes.
write(const io_vector * buffers, size_t n) -> ssize_tread(const io_vector * buffers, size_t n) const -> ssize_twrite(const void * buf, size_t n) const -> ssize_t
Write n bytes to file descriptor copying them from the array pointer by buf.
std::errc::resource_unavailable_try_again and std::errc::operation_in_progress
read(void * buf, size_t n) const -> ssize_t
Read n bytes from file descriptor and store them in the array pointed by buf.
std::errc::resource_unavailable_try_again and std::errc::operation_in_progress
release() -> fd_typeRelease and return raw file descriptor. After the release you have to manually close the file descriptor.
close() -> voidClose file descriptor.
operator=(fildes && rhs) -> fildes &Move-assignment.
~fildes()Close file descriptor. The method ignores errors reported by close(2) system call.
fildes(const char * filename, open_flag flags = open_flag(), mode_type mode = 0)
Construct file descriptor by opening file filename with open flags flags and mode mode.
fildes(fildes && rhs)Move-constructor.
fildes(fd_type rhs)explicit
Construct file descriptor by wrapping rhs.
operator=(const fildes & rhs) -> fildes &
Change file descriptor number of rhs to this->fd() by duplicating it with dup2(2) system call.
fildes(fd_type old_fd, const fildes & new_fd, open_flag flags = open_flag::close_on_exec)fildes(fildes && old_fd, const fildes & new_fd, open_flag flags = open_flag::close_on_exec)
Rename file descriptor number of rhs to this->fd() by duplicating it with dup2(2) system call.
fildes(const fildes & rhs)Change file descriptor number to an arbitrrary one by duplicating it with dup(2) system call.
fildes()public iovecBase class for File descriptor streambuf_traits.
in_avail(T & rhs) -> std::streamsizeDetermine how many bytes are available for reading from kernel buffer.
is_blocking(const T & rhs) -> boolDetermine if file descriptor is in bloking mode by checking its flags.
read(T & src, char_type * s, std::streamsize n) -> std::streamsize
Read n bytes to array pointed by s from buffer buf.
write(T & sink, const char_type * s, std::streamsize n) -> std::streamsize
Write n bytes from array pointed by s to buffer buf.