Title
std::filesystem enum classes overspecified
Status
c++17
Section
[fs.enum.file.type][fs.enum.copy.opts][fs.enum.dir.opts]
Submitter
Richard Smith

Created on 2016-03-19.00:00:00 last changed 89 months ago

Messages

Date: 2017-03-19.19:35:20

Proposed resolution:

  1. Strike the "Value" column from:

    • [fs.enum.file_type], Table 145 Enum class file_type

    • [fs.enum.copy.opts], Table 146 Enum class copy_options

    • [fs.enum.dir.opts], Table 148 Enum class enum.directory_options.

  2. Change [fs.enum.file_type] Table 145 Enum class file_type as indicated:

    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 does exist, but is of an operating system dependent type not covered by any of the other cases or the process does not have permission to query the file type The file exists but the type could not be determined
Date: 2016-08-04.02:52:49

[ 2016-08 Chicago ]

Wed AM: Move to Tentatively Ready

Date: 2016-03-19.00:00:00

The enum class std::filesystem::file_type specifies a collection of enumerators for describing the type of a file, but also specifies (1) the numeric values of the enumerators, and (2) that an implementation cannot extend the list with additional types known to it (and by extension, the standard cannot extend the list in future versions without breakage).

These both seem like mistakes in the design. I would suggest we remove the specification of numerical values, and maybe also

  • we allow implementations to add new implementation-defined value

  • we replace std::filesystem::file_type::unknown with a value that only means "exists but type could not be determined" and use implementation-specific values for other possibilities.

Similar overspecification exists for std::filesystem::copy_options and std::filesystem::directory_options, where again precise numerical values are specified.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-04 02:52:49adminsetmessages: + msg8380
2016-08-04 02:52:49adminsetstatus: new -> ready
2016-04-14 18:21:39adminsetmessages: + msg8050
2016-03-19 00:00:00admincreate