Supporting Functions

Let's look at some additional functions the Filesytem library has to offer.

So far we covered three elements of the filesystem: the path class, directory_entry and directory iterators. The library also provides a set of non-member functions.

Query functions

function description
filesystem::is_block_file() checks whether the given path refers to block device
filesystem::is_character_file() checks whether the given path refers to a character device
filesystem::is_directory() checks whether the given path refers to a directory
filesystem::is_empty() checks whether the given path refers to an empty file or directory
filesystem::is_fifo() checks whether the given path refers to a named pipe
filesystem::is_other() checks whether the argument refers to another file
filesystem::is_regular_file() checks whether the argument refers to a regular file
filesystem::is_socket() checks whether the argument refers to a named IPC socket
filesystem::is_symlink() checks whether the argument refers to a symbolic link
filesystem::status_known() checks whether file status is known
filesystem::exists() checks whether path refers to existing file system object
filesystem::file_size() returns the size of a file
filesystem::last_write_time() gets or sets the time of the last data modification

Get hands-on with 1200+ tech skills courses.