27 Input/output library [input.output]

27.10 File systems [filesystems]

27.10.10 Enumerations [fs.enum]

27.10.10.1 Enum class file_type [enum.file_type]

This enum class specifies constants used to identify file types, with the meanings listed in Table [tab:enum.file_type].

Table 122 — Enum class file_type
ConstantMeaning
none The type of the file has not been determined or an error occurred while trying to determine the type.
not_found Pseudo-type indicating the file was not found. [ Note: The file not being found is not considered an error while determining the type of a file.  — end note ]
regular Regular file
directory Directory file
symlink Symbolic link file
block Block special file
character Character special file
fifo FIFO or pipe file
socket Socket file
implementation-defined Implementations that support file systems having file types in addition to the above file_type types shall supply implementation-defined file_type constants to separately identify each of those additional file types
unknown The file exists but the type could not be determined

27.10.10.2 Enum class copy_options [enum.copy_options]

The enum class type copy_options is a bitmask type ([bitmask.types]) that specifies bitmask constants used to control the semantics of copy operations. The constants are specified in option groups with the meanings listed in Table [tab:enum.copy_options]. Constant none is shown in each option group for purposes of exposition; implementations shall provide only a single definition. Calling a library function with more than a single constant for an option group results in undefined behavior.

Table 123 — Enum class copy_options
Option group controlling copy_file function effects for existing target files
ConstantMeaning
none (Default) Error; file already exists.
skip_existing Do not overwrite existing file, do not report an error.
overwrite_existing Overwrite the existing file.
update_existing Overwrite the existing file if it is older than the replacement file.
Option group controlling copy function effects for sub-directories
ConstantMeaning
none (Default) Do not copy sub-directories.
recursive Recursively copy sub-directories and their contents.
Option group controlling copy function effects for symbolic links
ConstantMeaning
none (Default) Follow symbolic links.
copy_symlinks Copy symbolic links as symbolic links rather than copying the files that they point to.
skip_symlinks Ignore symbolic links.
Option group controlling copy function effects for choosing the form of copying
ConstantMeaning
none (Default) Copy content.
directories_only Copy directory structure only, do not copy non-directory files.
create_symlinks Make symbolic links instead of copies of files. The source path shall be an absolute path unless the destination path is in the current directory.
create_hard_links Make hard links instead of copies of files.

27.10.10.3 Enum class perms [enum.perms]

The enum class type perms is a bitmask type ([bitmask.types]) that specifies bitmask constants used to identify file permissions, with the meanings listed in Table [tab:enum.perms].

Table 124 — Enum class perms
NameValuePOSIXDefinition or notes
(octal)macro
none 0 There are no permissions set for the file.
owner_read 0400 S_IRUSR Read permission, owner
owner_write 0200 S_IWUSR Write permission, owner
owner_exec 0100 S_IXUSR Execute/search permission, owner
owner_all 0700 S_IRWXU Read, write, execute/search by owner;
owner_read | owner_write | owner_exec
group_read 040 S_IRGRP Read permission, group
group_write 020 S_IWGRP Write permission, group
group_exec 010 S_IXGRP Execute/search permission, group
group_all 070 S_IRWXG Read, write, execute/search by group;
group_read | group_write | group_exec
others_read 04 S_IROTH Read permission, others
others_write 02 S_IWOTH Write permission, others
others_exec 01 S_IXOTH Execute/search permission, others
others_all 07 S_IRWXO Read, write, execute/search by others;
others_read | others_write | others_exec
all 0777 owner_all | group_all | others_all
set_uid 04000 S_ISUID Set-user-ID on execution
set_gid 02000 S_ISGID Set-group-ID on execution
sticky_bit 01000 S_ISVTX Operating system dependent.
mask 07777 all | set_uid | set_gid | sticky_bit
unknown 0xFFFF The permissions are not known, such as when a file_status object is created without specifying the permissions
add_perms 0x10000 permissions() shall bitwise or the perm argument's permission bits to the file's current permission bits.
remove_perms 0x20000 permissions() shall bitwise and the complement of perm argument's permission bits to the file's current permission bits.
symlink_nofollow 0x40000 permissions() shall change the permissions of symbolic links.

27.10.10.4 Enum class directory_options [enum.directory_options]

The enum class type directory_options is a bitmask type ([bitmask.types]) that specifies bitmask constants used to identify directory traversal options, with the meanings listed in Table [tab:enum.directory_options].

Table 125 — Enum class directory_options
NameMeaning
none (Default) Skip directory symlinks, permission denied is an error.
follow_directory_symlink Follow rather than skip directory symlinks.
skip_permission_denied Skip directories that would otherwise result in permission denied.