29 Input/output library [input.output]

29.11 File systems [filesystems]

29.11.9 Enumerations [fs.enum]

29.11.9.1 Enum path​::​format [fs.enum.path.format]

This enum specifies constants used to identify the format of the character sequence, with the meanings listed in Table 128.
Table 128: Enum path​::​format   [tab:fs.enum.path.format]
Name
Meaning
native_­format
The native pathname format.
generic_­format
The generic pathname format.
auto_­format
The interpretation of the format of the character sequence is implementation-defined.
The implementation may inspect the content of the character sequence to determine the format.
[Note
:
For POSIX-based systems, native and generic formats are equivalent and the character sequence should always be interpreted in the same way.
— end note
]

29.11.9.2 Enum class file_­type [fs.enum.file.type]

This enum class specifies constants used to identify file types, with the meanings listed in Table 129.
The values of the constants are distinct.
Table 129: Enum class file_­type   [tab:fs.enum.file.type]
Constant
Meaning
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

29.11.9.3 Enum class copy_­options [fs.enum.copy.opts]

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 130.
The constant none represents the empty bitmask, and is shown in each option group for purposes of exposition; implementations shall provide only a single definition.
Every other constant in the table represents a distinct bitmask element.
Table 130: Enum class copy_­options   [tab:fs.enum.copy.opts]
Option group controlling copy_­file function effects for existing target files
Constant
Meaning
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
Constant
Meaning
none
(Default) Do not copy sub-directories.
recursive
Recursively copy sub-directories and their contents.
Option group controlling copy function effects for symbolic links
Constant
Meaning
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
Constant
Meaning
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.

29.11.9.4 Enum class perms [fs.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 131.
Table 131: Enum class perms   [tab:fs.enum.perms]
Name
Value
POSIX
Definition 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

29.11.9.5 Enum class perm_­options [fs.enum.perm.opts]

The enum class type perm_­options is a bitmask type ([bitmask.types]) that specifies bitmask constants used to control the semantics of permissions operations, with the meanings listed in Table 132.
The bitmask constants are bitmask elements.
In Table 132 perm denotes a value of type perms passed to permissions.
Table 132: Enum class perm_­options   [tab:fs.enum.perm.opts]
Name
Meaning
replace
permissions shall replace the file's permission bits with perm
add
permissions shall replace the file's permission bits with the bitwise OR of perm and the file's current permission bits.
remove
permissions shall replace the file's permission bits with the bitwise AND of the complement of perm and the file's current permission bits.
nofollow
permissions shall change the permissions of a symbolic link itself rather than the permissions of the file the link resolves to.

29.11.9.6 Enum class directory_­options [fs.enum.dir.opts]

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 133.
The constant none represents the empty bitmask; every other constant in the table represents a distinct bitmask element.
Table 133: Enum class directory_­options   [tab:fs.enum.dir.opts]
Name
Meaning
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.