Boost C++ Libraries

PrevUpHomeNext

Type perms

boost::filesystem::perms — Specifies bitmask constants uses to identify file permissions.

Synopsis

// In header: <boost/filesystem/file_status.hpp>



enum perms { no_perms = 0, owner_read = 0400, owner_write = 0200, 
             owner_exe = 0100, owner_all = 0700, group_read = 040, 
             group_write = 020, group_exe = 010, group_all = 070, 
             others_read = 04, others_write = 02, others_exe = 01, 
             others_all = 07, all_all = 0777, set_uid_on_exe = 04000, 
             set_gid_on_exe = 02000, sticky_bit = 01000, perms_mask = 07777, 
             perms_not_known, add_perms, remove_perms, symlink_perms };

Description

[Note] Note

ISO/IEC 9945(POSIX) specifies actual values, and those values have been adopted here because they are very familiar and ingrained for many POSIX users.

[Note] Note

On Windows, all permissions except write are currently ignored. There is only a single write permission; setting write permission for owner, group, or others sets write permission for all, and removing write permission for owner, group, or others removes write permission for all.

no_perms
There are no permissions set for the file.
[Note] Note

file_not_found is no_perms rather than perms_not_known.

owner_read
Read permission for owner (S_IRUSR).
owner_write
Write permission for owner (S_IWUSR).
owner_exe
Execute/search permission for owner (S_IXUSR).
owner_all
Read, write, execute/search by owner (S_IRWXU).
group_read
Read permission for group members (S_IRGRP).
group_write
Write permissionfor group members (S_IWGRP).
group_exe
Execute/search permission for group members (S_IXGRP).
group_all
Read, write, execute/search by group members (S_IRWXG).
others_read
Read permission for other users (S_IROTH).
others_write
Write permission for other users (S_IWOTH).
others_exe
Execute/search permission for other users (S_IXOTH).
others_all
Read, write, execute/search by other users (S_IRWXO).
all_all
owner_all | group_all | others_all
set_uid_on_exe
Set-user-ID on execution (S_ISUID).
set_gid_on_exe
Set-group-ID on execution (S_ISGID).
sticky_bit
Sticky bit (S_ISVTX).

Support and semantics vary between platforms. For example:

  • POSIX XSI: On directories, restricted deletion flag

  • V7: 'sticky bit': save swapped text even after use

  • SunOS: On non-directories: don't cache this file

  • SVID-v4.2: On directories: restricted deletion flag

Also see http://en.wikipedia.org/wiki/Sticky_bit.

perms_mask
all_all | set_uid_on_exe | set_gid_on_exe | sticky_bit
perms_not_known
Special value present when directory_entry cache is not loaded.
add_perms
Special value that indicates that permissions() should add the given permission bits to the current bits.

Must not be combined with remove_perms.

remove_perms
Special value that indicates that permissions() should remove the given permission bits from the current bits.

Must not be combined with add_perms.

symlink_perms
Special value that indicates that permissions() should not resolve symbolic links.
[Note] Note

This option is implied on Windows.


PrevUpHomeNext