Title
status(p).permissions() and symlink_status(p).permissions() are not specified
Status
c++17
Section
[fs.op.status][fs.op.symlink.status]
Submitter
Eric Fiselier

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

Messages

Date: 2016-06-27.16:42:33

Proposed resolution:

This wording is relative to N4594.

  1. Change [fs.op.status] as indicated:

    file_status status(const path& p, error_code& ec) noexcept;
    

    -4- Effects: If possible, determines the attributes of the file p resolves to, as if by POSIX stat().using POSIX stat() to obtain a POSIX struct stat.. […]

    -?- Let prms denote the result of (m & perms::mask), where m is determined as if by converting the st_mode member of the obtained struct stat to the type perms.

    -5- Returns:

    • If ec != error_code():

      • […]

    • Otherwise

      • If the attributes indicate a regular file, as if by POSIX S_ISREG, returns file_status(file_type::regular, prms). […]

      • Otherwise, if the attributes indicate a directory, as if by POSIX S_ISDIR, returns file_status(file_type::directory, prms). […]

      • Otherwise, if the attributes indicate a block special file, as if by POSIX S_ISBLK, returns file_status(file_type::block, prms).

      • Otherwise, if the attributes indicate a character special file, as if by POSIX S_ISCHR, returns file_status(file_type::character, prms).

      • Otherwise, if the attributes indicate a fifo or pipe file, as if by POSIX S_ISFIFO, returns file_status(file_type::fifo, prms).

      • Otherwise, if the attributes indicate a socket, as if by POSIX S_ISSOCK, returns file_status(file_type::socket, prms).

      • Otherwise, returns file_status(file_type::unknown, prms).

  2. Change [fs.op.symlink_status] as indicated:

    file_status symlink_status(const path& p);
    file_status symlink_status(const path& p, error_code& ec) noexcept;
    

    -1- Effects: Same as status(), above, except that the attributes of p are determined as if by POSIX lstat() using POSIX lstat() to obtain a POSIX struct stat.

    -?- Let prms denote the result of (m & perms::mask), where m is determined as if by converting the st_mode member of the obtained struct stat to the type perms.

    -2- Returns: Same as status(), above, except that if the attributes indicate a symbolic link, as if by POSIX S_ISLNK, returns file_status(file_type::symlink, prms). The signature with argument ec returns file_status(file_type::none) if an error occurs.

Date: 2016-06-27.16:42:33

[ 2016-06 Oulu ]

Moved to P0/Ready during issues prioritization.

Friday: status to Immediate

Date: 2016-06-22.05:30:04

[ 2016-06, Oulu ]

2720 is a related issue.

Date: 2016-06-19.00:00:00

The current specification for status(p) and symlink_status(p) omits any mention on setting permissions() on the returned file_status. Obviously they should be set, but as currently specified the permissions() will always be perms::unknown.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-06-28 13:14:43adminsetstatus: immediate -> wp
2016-06-27 16:42:33adminsetmessages: + msg8207
2016-06-27 16:42:33adminsetstatus: new -> immediate
2016-06-22 05:30:04adminsetmessages: + msg8200
2016-06-21 23:18:16adminsetmessages: + msg8198
2016-06-19 00:00:00admincreate