[fs.enum]
# 31 Input/output library [[input.output]](./#input.output)
## 31.12 File systems [[filesystems]](filesystems#fs.enum)
### 31.12.8 Enumerations [fs.enum]
#### [31.12.8.1](#path.format) Enum path::format [[fs.enum.path.format]](fs.enum.path.format)
[1](#path.format-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15695)
This enum specifies constants used to identify the format of the character
sequence, with the meanings listed in Table [148](#tab:fs.enum.path.format "Table 148: Enum path::format")[.](#path.format-1.sentence-1)
Table [148](#tab:fs.enum.path.format) — Enum path::format [[tab:fs.enum.path.format]](./tab:fs.enum.path.format)
| [ð](#tab:fs.enum.path.format-row-1)
**Name** | **Meaning** |
| --- | --- |
| [ð](#tab:fs.enum.path.format-row-2)
native_format | The native pathname format[.](#tab:fs.enum.path.format-row-2-column-2-sentence-1) |
| [ð](#tab:fs.enum.path.format-row-3)
generic_format | The generic pathname format[.](#tab:fs.enum.path.format-row-3-column-2-sentence-1) |
| [ð](#tab:fs.enum.path.format-row-4)
auto_format | The interpretation of the format of the character sequence is implementation-defined[.](#tab:fs.enum.path.format-row-4-column-2-sentence-1)
The implementation may inspect the content of the character sequence to determine the format[.](#tab:fs.enum.path.format-row-4-column-2-sentence-2)
*Recommended practice*: For POSIX-based systems, native and generic formats are equivalent and the character sequence should always be interpreted in the same way[.](#tab:fs.enum.path.format-row-4-column-2-sentence-3) |
#### [31.12.8.2](#file.type) Enum class file_type [[fs.enum.file.type]](fs.enum.file.type)
[1](#file.type-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15720)
This enum class specifies constants used to identify file types,
with the meanings listed in Table [149](#tab:fs.enum.file.type "Table 149: Enum class file_type")[.](#file.type-1.sentence-1)
The values of the constants are distinct[.](#file.type-1.sentence-2)
Table [149](#tab:fs.enum.file.type) — Enum class file_type [[tab:fs.enum.file.type]](./tab:fs.enum.file.type)
| [ð](#tab:fs.enum.file.type-row-1)
**Constant** | **Meaning** |
| --- | --- |
| [ð](#tab:fs.enum.file.type-row-2)
[none](#lib:file_type,none "31.12.8.2 Enum class file_type [fs.enum.file.type]") | The type of the file has not been determined or an error occurred while trying to determine the type[.](#tab:fs.enum.file.type-row-2-column-2-sentence-1) |
| [ð](#tab:fs.enum.file.type-row-3)
[not_found](#lib:file_type,not_found "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Pseudo-type indicating the file was not found[.](#tab:fs.enum.file.type-row-3-column-2-sentence-1)
[*Note [1](#tab:fs.enum.file.type-row-3-column-2-note-1)*:
The file not being found is not considered an error while determining the type of a file[.](#tab:fs.enum.file.type-row-3-column-2-sentence-2) â *end note*] |
| [ð](#tab:fs.enum.file.type-row-4)
[regular](#lib:file_type,regular "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Regular file |
| [ð](#tab:fs.enum.file.type-row-5)
[directory](#lib:file_type,directory "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Directory file |
| [ð](#tab:fs.enum.file.type-row-6)
[symlink](#lib:file_type,symlink "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Symbolic link file |
| [ð](#tab:fs.enum.file.type-row-7)
[block](#lib:file_type,block "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Block special file |
| [ð](#tab:fs.enum.file.type-row-8)
[character](#lib:file_type,character "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Character special file |
| [ð](#tab:fs.enum.file.type-row-9)
[fifo](#lib:file_type,fifo "31.12.8.2 Enum class file_type [fs.enum.file.type]") | FIFO or pipe file |
| [ð](#tab:fs.enum.file.type-row-10)
[socket](#lib:file_type,socket "31.12.8.2 Enum class file_type [fs.enum.file.type]") | Socket file |
| [ð](#tab:fs.enum.file.type-row-11)
*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 |
| [ð](#tab:fs.enum.file.type-row-12)
[unknown](#lib:file_type,unknown "31.12.8.2 Enum class file_type [fs.enum.file.type]") | The file exists but the type cannot be determined |
#### [31.12.8.3](#copy.opts) Enum class copy_options [[fs.enum.copy.opts]](fs.enum.copy.opts)
[1](#copy.opts-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15766)
The enum class type copy_options is a bitmask type ([[bitmask.types]](bitmask.types "16.3.3.3.3 Bitmask types")) that specifies bitmask constants used to control the semantics of
copy operations[.](#copy.opts-1.sentence-1)
The constants are specified in option groups with the meanings listed in Table [150](#tab:fs.enum.copy.opts "Table 150: Enum class copy_options")[.](#copy.opts-1.sentence-2)
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[.](#copy.opts-1.sentence-3)
Every other constant in the table represents a distinct bitmask element[.](#copy.opts-1.sentence-4)
Table [150](#tab:fs.enum.copy.opts) — Enum class copy_options [[tab:fs.enum.copy.opts]](./tab:fs.enum.copy.opts)
| [ð](#tab:fs.enum.copy.opts-row-1)
**Option group controlling copy_file function effects for existing target files** | |
| --- | --- |
| [ð](#tab:fs.enum.copy.opts-row-2)
**Constant** | **Meaning** |
| [ð](#tab:fs.enum.copy.opts-row-3)
[none](#lib:copy_options,none "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | (Default) Error; file already exists[.](#tab:fs.enum.copy.opts-row-3-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-4)
[skip_existing](#lib:copy_options,skip_existing "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Do not overwrite existing file, do not report an error[.](#tab:fs.enum.copy.opts-row-4-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-5)
[overwrite_existing](#lib:copy_options,overwrite_existing "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Overwrite the existing file[.](#tab:fs.enum.copy.opts-row-5-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-6)
[update_existing](#lib:copy_options,update_existing "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Overwrite the existing file if it is older than the replacement file[.](#tab:fs.enum.copy.opts-row-6-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-7)
**Option group controlling copy function effects for subdirectories** | |
| [ð](#tab:fs.enum.copy.opts-row-8)
**Constant** | **Meaning** |
| [ð](#tab:fs.enum.copy.opts-row-9)
[none](#lib:copy_options,none "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | (Default) Do not copy subdirectories[.](#tab:fs.enum.copy.opts-row-9-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-10)
[recursive](#lib:copy_options,recursive "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Recursively copy subdirectories and their contents[.](#tab:fs.enum.copy.opts-row-10-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-11)
**Option group controlling copy function effects for symbolic links** | |
| [ð](#tab:fs.enum.copy.opts-row-12)
**Constant** | **Meaning** |
| [ð](#tab:fs.enum.copy.opts-row-13)
[none](#lib:copy_options,none "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | (Default) Follow symbolic links[.](#tab:fs.enum.copy.opts-row-13-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-14)
[copy_symlinks](#lib:copy_options,copy_symlinks "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Copy symbolic links as symbolic links rather than copying the files that they point to[.](#tab:fs.enum.copy.opts-row-14-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-15)
[skip_symlinks](#lib:copy_options,skip_symlinks "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Ignore symbolic links[.](#tab:fs.enum.copy.opts-row-15-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-16)
**Option group controlling copy function effects for choosing the form of copying** | |
| [ð](#tab:fs.enum.copy.opts-row-17)
**Constant** | **Meaning** |
| [ð](#tab:fs.enum.copy.opts-row-18)
[none](#lib:copy_options,none "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | (Default) Copy content[.](#tab:fs.enum.copy.opts-row-18-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-19)
[directories_only](#lib:copy_options,directories_only "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Copy directory structure only, do not copy non-directory files[.](#tab:fs.enum.copy.opts-row-19-column-2-sentence-1) |
| [ð](#tab:fs.enum.copy.opts-row-20)
[create_symlinks](#lib:copy_options,create_symlinks "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Make symbolic links instead of copies of files[.](#tab:fs.enum.copy.opts-row-20-column-2-sentence-1)
The source path shall be an absolute path unless the destination path is in the current directory[.](#tab:fs.enum.copy.opts-row-20-column-2-sentence-2) |
| [ð](#tab:fs.enum.copy.opts-row-21)
[create_hard_links](#lib:copy_options,create_hard_links "31.12.8.3 Enum class copy_options [fs.enum.copy.opts]") | Make hard links instead of copies of files[.](#tab:fs.enum.copy.opts-row-21-column-2-sentence-1) |
#### [31.12.8.4](#perms) Enum class perms [[fs.enum.perms]](fs.enum.perms)
[1](#perms-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15823)
The enum class type perms is a bitmask type ([[bitmask.types]](bitmask.types "16.3.3.3.3 Bitmask types")) that specifies bitmask constants used to identify file
permissions, with the meanings listed in Table [151](#tab:fs.enum.perms "Table 151: Enum class perms")[.](#perms-1.sentence-1)
Table [151](#tab:fs.enum.perms) — Enum class perms [[tab:fs.enum.perms]](./tab:fs.enum.perms)
| [ð](#tab:fs.enum.perms-row-1)
**Name** | **Value** | **POSIX** | **Definition or notes** |
| --- | --- | --- | --- |
| [ð](#tab:fs.enum.perms-row-2) | **(octal)** | **macro** | |
| [ð](#tab:fs.enum.perms-row-3)
[none](#lib:perms,none "31.12.8.4 Enum class perms [fs.enum.perms]") | 0 | | There are no permissions set for the file[.](#tab:fs.enum.perms-row-3-column-4-sentence-1) |
| [ð](#tab:fs.enum.perms-row-4)
[owner_read](#lib:perms,owner_read "31.12.8.4 Enum class perms [fs.enum.perms]") | 0400 | S_IRUSR | Read permission, owner |
| [ð](#tab:fs.enum.perms-row-5)
[owner_write](#lib:perms,owner_write "31.12.8.4 Enum class perms [fs.enum.perms]") | 0200 | S_IWUSR | Write permission, owner |
| [ð](#tab:fs.enum.perms-row-6)
[owner_exec](#lib:perms,owner_exec "31.12.8.4 Enum class perms [fs.enum.perms]") | 0100 | S_IXUSR | Execute/search permission, owner |
| [ð](#tab:fs.enum.perms-row-7)
[owner_all](#lib:perms,owner_all "31.12.8.4 Enum class perms [fs.enum.perms]") | 0700 | S_IRWXU | Read, write, execute/search by owner; owner_read | owner_write | owner_exec |
| [ð](#tab:fs.enum.perms-row-8)
[group_read](#lib:perms,group_read "31.12.8.4 Enum class perms [fs.enum.perms]") | 040 | S_IRGRP | Read permission, group |
| [ð](#tab:fs.enum.perms-row-9)
[group_write](#lib:perms,group_write "31.12.8.4 Enum class perms [fs.enum.perms]") | 020 | S_IWGRP | Write permission, group |
| [ð](#tab:fs.enum.perms-row-10)
[group_exec](#lib:perms,group_exec "31.12.8.4 Enum class perms [fs.enum.perms]") | 010 | S_IXGRP | Execute/search permission, group |
| [ð](#tab:fs.enum.perms-row-11)
[group_all](#lib:perms,group_all "31.12.8.4 Enum class perms [fs.enum.perms]") | 070 | S_IRWXG | Read, write, execute/search by group; group_read | group_write | group_exec |
| [ð](#tab:fs.enum.perms-row-12)
[others_read](#lib:perms,others_read "31.12.8.4 Enum class perms [fs.enum.perms]") | 04 | S_IROTH | Read permission, others |
| [ð](#tab:fs.enum.perms-row-13)
[others_write](#lib:perms,others_write "31.12.8.4 Enum class perms [fs.enum.perms]") | 02 | S_IWOTH | Write permission, others |
| [ð](#tab:fs.enum.perms-row-14)
[others_exec](#lib:perms,others_exec "31.12.8.4 Enum class perms [fs.enum.perms]") | 01 | S_IXOTH | Execute/search permission, others |
| [ð](#tab:fs.enum.perms-row-15)
[others_all](#lib:perms,others_all "31.12.8.4 Enum class perms [fs.enum.perms]") | 07 | S_IRWXO | Read, write, execute/search by others; others_read | others_write | others_exec |
| [ð](#tab:fs.enum.perms-row-16)
[all](#lib:perms,all "31.12.8.4 Enum class perms [fs.enum.perms]") | 0777 | | owner_all | group_all | others_all |
| [ð](#tab:fs.enum.perms-row-17)
[set_uid](#lib:perms,set_uid "31.12.8.4 Enum class perms [fs.enum.perms]") | 04000 | S_ISUID | Set-user-ID on execution |
| [ð](#tab:fs.enum.perms-row-18)
[set_gid](#lib:perms,set_gid "31.12.8.4 Enum class perms [fs.enum.perms]") | 02000 | S_ISGID | Set-group-ID on execution |
| [ð](#tab:fs.enum.perms-row-19)
[sticky_bit](#lib:perms,sticky_bit "31.12.8.4 Enum class perms [fs.enum.perms]") | 01000 | S_ISVTX | Operating system dependent[.](#tab:fs.enum.perms-row-19-column-4-sentence-1) |
| [ð](#tab:fs.enum.perms-row-20)
[mask](#lib:perms,mask "31.12.8.4 Enum class perms [fs.enum.perms]") | 07777 | | all | set_uid | set_gid | sticky_bit |
| [ð](#tab:fs.enum.perms-row-21)
[unknown](#lib:perms,unknown "31.12.8.4 Enum class perms [fs.enum.perms]") | 0xFFFF | | The permissions are not known, such as when a file_status object is created without specifying the permissions |
#### [31.12.8.5](#perm.opts) Enum class perm_options [[fs.enum.perm.opts]](fs.enum.perm.opts)
[1](#perm.opts-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15882)
The enum class type perm_options is a bitmask type ([[bitmask.types]](bitmask.types "16.3.3.3.3 Bitmask types")) that specifies bitmask constants used to
control the semantics of permissions operations,
with the meanings listed in Table [152](#tab:fs.enum.perm.opts "Table 152: Enum class perm_options")[.](#perm.opts-1.sentence-1)
The bitmask constants are bitmask elements[.](#perm.opts-1.sentence-2)
In Table [152](#tab:fs.enum.perm.opts "Table 152: Enum class perm_options") perm denotes a value of type perms passed to permissions[.](#perm.opts-1.sentence-3)
Table [152](#tab:fs.enum.perm.opts) — Enum class perm_options [[tab:fs.enum.perm.opts]](./tab:fs.enum.perm.opts)
| [ð](#tab:fs.enum.perm.opts-row-1)
**Name** | **Meaning** |
| --- | --- |
| [ð](#tab:fs.enum.perm.opts-row-2)
[replace](#lib:perm_options,replace "31.12.8.5 Enum class perm_options [fs.enum.perm.opts]") | permissions shall replace the file's permission bits with perm |
| [ð](#tab:fs.enum.perm.opts-row-3)
[add](#lib:perm_options,add "31.12.8.5 Enum class perm_options [fs.enum.perm.opts]") | permissions shall replace the file's permission bits with the bitwise or of perm and the file's current permission bits[.](#tab:fs.enum.perm.opts-row-3-column-2-sentence-1) |
| [ð](#tab:fs.enum.perm.opts-row-4)
[remove](#lib:perm_options,remove "31.12.8.5 Enum class perm_options [fs.enum.perm.opts]") | permissions shall replace the file's permission bits with the bitwise and of the complement of perm and the file's current permission bits[.](#tab:fs.enum.perm.opts-row-4-column-2-sentence-1) |
| [ð](#tab:fs.enum.perm.opts-row-5)
[nofollow](#lib:perm_options,nofollow "31.12.8.5 Enum class perm_options [fs.enum.perm.opts]") | permissions shall change the permissions of a symbolic link itself rather than the permissions of the file the link resolves to[.](#tab:fs.enum.perm.opts-row-5-column-2-sentence-1) |
#### [31.12.8.6](#dir.opts) Enum class directory_options [[fs.enum.dir.opts]](fs.enum.dir.opts)
[1](#dir.opts-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L15913)
The enum class type directory_options is a bitmask
type ([[bitmask.types]](bitmask.types "16.3.3.3.3 Bitmask types")) that specifies bitmask constants used to identify
directory traversal options, with the meanings listed in Table [153](#tab:fs.enum.dir.opts "Table 153: Enum class directory_options")[.](#dir.opts-1.sentence-1)
The constant none represents the empty bitmask;
every other constant in the table represents a distinct bitmask element[.](#dir.opts-1.sentence-2)
Table [153](#tab:fs.enum.dir.opts) — Enum class directory_options [[tab:fs.enum.dir.opts]](./tab:fs.enum.dir.opts)
| [ð](#tab:fs.enum.dir.opts-row-1)
**Name** | **Meaning** |
| --- | --- |
| [ð](#tab:fs.enum.dir.opts-row-2)
[none](#lib:directory_options,none "31.12.8.6 Enum class directory_options [fs.enum.dir.opts]") | (Default) Skip directory symlinks, permission denied is an error[.](#tab:fs.enum.dir.opts-row-2-column-2-sentence-1) |
| [ð](#tab:fs.enum.dir.opts-row-3)
[follow_directory_symlink](#lib:directory_options,follow_directory_symlink "31.12.8.6 Enum class directory_options [fs.enum.dir.opts]") | Follow rather than skip directory symlinks[.](#tab:fs.enum.dir.opts-row-3-column-2-sentence-1) |
| [ð](#tab:fs.enum.dir.opts-row-4)
[skip_permission_denied](#lib:directory_options,skip_permission_denied "31.12.8.6 Enum class directory_options [fs.enum.dir.opts]") | Skip directories that would otherwise result in permission denied[.](#tab:fs.enum.dir.opts-row-4-column-2-sentence-1) |