io_status


Use an I/O object's os_io_status to obtain and modify many of its characteristics, such as its mode, user, and group.

The following are ways to obtain an os_io_status object.

Library

IO<ToolKit>

Declaration

#include <ospace/io/iostatus.h>

class os_io_status

Interface

Constructor
os_io_status()
Constructs an I/O object that is not initialized.
Constructor
os_io_status( const os_io_status& io_status )
Constructs an I/O object that is a copy of io_status .
Constructor
os_io_status( const string& path , enum Encoding enc = Ascii )
Constructs an I/O object with the status of the file called path . The encoding is only appacable to windows environment. Here the default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_io_toolkit_error

=
os_io_status& operator=( const os_io_status& io_status )
Assigns an I/O object from io_status .
==
bool operator==( const os_io_status& io_status ) const
Returns true if I contain the same status information as io_status .
(os_stat_t)
operator os_stat_t() const
Returns the I/O object as an os_stat_t structure.
access_time
os_time_t access_time() const
Returns the time that the I/O object was last accessed.

Throws: os_io_toolkit_error

device
os_dev_t device() const
Returns the device identifier that is associated with the I/O object.
group
os_gid_t group( enum Encoding enc = Ascii ) const
Returns the group of the I/O object. Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
group
void group( os_gid_t group , enum Encoding enc = Ascii )
Sets the I/O object's group to group . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_io_toolkit_error

inode
ino_t inode() const
Returns the serial number of the I/O object. In most architectures, this serial number is called the inode number and identifies a physical location on some storage media associated with the descriptor or file. A file can be uniquely identified by its device identifier and its serial number.
link_count
nlink_t link_count() const
Returns the number of links made to this I/O object.
mode
os_mode_t mode() const
Returns the mode (permissions) of the I/O object.
mode
void mode( os_mode_t mode , enum Encoding enc = Ascii )
Sets mode to mode . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_io_toolkit_error

modify_time
os_time_t modify_time() const
Returns the time that the I/O object was last modified.

Throws: os_io_toolkit_error

print
void print( ostream& stream ) const
Prints the object to stream .
raw_device
os_dev_t raw_device() const
Returns the device identifier that is associated with the I/O object.
size
os_off_t size() const
Returns the I/O object's size, in bytes.
status_time
os_time_t status_time() const
Returns the time that the status of the I/O object was last modified. Status information includes user and group of owner, mode, and link counts.

Throws: os_io_toolkit_error

user
os_uid_t user( enum Encoding enc = Ascii ) const
Returns the user of the I/O object. Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
user
void user( os_uid_t user , enum Encoding enc = Ascii )
Sets the object's user to user .Default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_io_toolkit_error

UNIX-Specific Interface

Constructor
os_io_status( os_desc_t descriptor )
Constructs an I/O object with status information of the open I/O object with a descriptor matching descriptor .

Throws: os_io_toolkit_error

Constructor
os_io_status( const string& path , int type )
If type is for_file , constructs and I/O object with the status of the file called path . If type is for_link , constructs an I/O object with the status of the symbolic link called path .

Throws: os_io_toolkit_error

block_count
long block_count() const
Returns the number of blocks allocated to the I/O object.
block_size
long block_size() const
Returns the preferred I/O block size, in bytes.
get_major
int get_major() const
Returns the major device identifier that is associated with the I/O object.
get_minor
int get_minor() const
Returns the minor device identifier that is associated with the I/O object.
raw_major
int raw_major() const
Returns the major device identifier that is associated with the I/O object.
raw_minor
int raw_minor() const
Returns the minor device identifier that is associated with the I/O object.

Non-Member Functions

<<
ostream& operator<<( ostream& stream , const os_io_status& status )
Prints status to stream .

Universal Streaming Service

#include <ospace/uss/io.h>

<<
os_bstream& operator<<( os_bstream& stream , const os_io_status& status )
Writes status to stream .
>>
os_bstream& operator>>( os_bstream& stream , os_io_status& status )
Reads status from stream .

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.