Asio Extensions
Additional functionality built on top of (Boost.)Asio
File metadata
enum  asioext::file_attrs : uint32_t {
  asioext::file_attrs::none = 0, asioext::file_attrs::hidden = 1 << 0, asioext::file_attrs::system = 1 << 1, asioext::file_attrs::archive = 1 << 2,
  asioext::file_attrs::no_dump = 1 << 3, asioext::file_attrs::not_indexed = 1 << 4, asioext::file_attrs::user_immutable = 1 << 5, asioext::file_attrs::system_immutable = 1 << 6,
  asioext::file_attrs::user_no_unlink = 1 << 7, asioext::file_attrs::system_no_unlink = 1 << 8
}
 Names for file attributes. More...
 
enum  asioext::file_attr_options { asioext::file_attr_options::none = 0, asioext::file_attr_options::replace = 1 << 0, asioext::file_attr_options::add = 1 << 1, asioext::file_attr_options::remove = 1 << 2 }
 Options to control the behavior of asioext::file_handle::attributes(file_attrs,file_attr_options) More...
 
enum  asioext::file_perms {
  asioext::file_perms::none = 0, asioext::file_perms::owner_read = 0400, asioext::file_perms::owner_write = 0200, asioext::file_perms::owner_exec = 0100,
  asioext::file_perms::owner_all = 0700, asioext::file_perms::group_read = 040, asioext::file_perms::group_write = 020, asioext::file_perms::group_exec = 010,
  asioext::file_perms::group_all = 070, asioext::file_perms::others_read = 04, asioext::file_perms::others_write = 02, asioext::file_perms::others_exec = 01,
  asioext::file_perms::others_all = 07, asioext::file_perms::all = 0777, asioext::file_perms::set_uid = 04000, asioext::file_perms::set_gid = 02000,
  asioext::file_perms::sticky_bit = 01000, asioext::file_perms::create_default = 0666, asioext::file_perms::mask = 07777, asioext::file_perms::unknown = 0xFFFF
}
 Names for permissions. More...
 
enum  asioext::file_perm_options { asioext::file_perm_options::none = 0, asioext::file_perm_options::replace = 1 << 0, asioext::file_perm_options::add = 1 << 1, asioext::file_perm_options::remove = 1 << 2 }
 Options to control the behavior of asioext::file_handle::permissions(file_perms,file_perm_options) More...
 

Detailed Description

Enumeration Type Documentation

◆ file_attr_options

Options to control the behavior of asioext::file_handle::attributes(file_attrs,file_attr_options)

This enum represents options for the file attributes modifier. file_attr_options meets the requirements of BitmaskType.

Enumerator
none 
replace 

Replace all current attributes.

add 

Replace attributes with the bitwise OR of the argument and the current attributes.

remove 

Replace attributes with the bitwise AND of the negated argument and the current attributes.

◆ file_attrs

enum asioext::file_attrs : uint32_t
strong

Names for file attributes.

This enum represents file attributes. file_attrs meets the requirements of BitmaskType.

Note
The file's attributes are replaced if neither file_attr_options::add nor file_attr_options::remove has been set.
Enumerator
none 
hidden 

The file is hidden. It is typically not included in directory listings.

Note
Only supported on Windows and FreeBSD.
system 

The file is used (exclusively) by the operating system.

Note
Only supported on Windows and FreeBSD.
archive 

The file needs to be archived.

Typically this flag is used to mark files for backup.

Note
Only supported on Windows and FreeBSD.
no_dump 

The file is not backed up by the dump program.

Note
Only supported on mac OS / *BSD systems.
not_indexed 

The file isn't indexed by the Windows Content Indexing service.

Note
Only supported on Windows.
user_immutable 

The file cannot be changed.

Note
Only supported on mac OS / *BSD systems.
system_immutable 

The file cannot be changed.

This attribute may only be set by the super-user.

Note
Only supported on mac OS / *BSD systems.
user_no_unlink 

The file cannot be deleted, nor renamed.

Note
Only supported on FreeBSD.
system_no_unlink 

The file cannot be deleted, nor renamed.

This attribute may only be set by the super-user.

Note
Only supported on FreeBSD.

◆ file_perm_options

Options to control the behavior of asioext::file_handle::permissions(file_perms,file_perm_options)

This enum represents options for the file permissions modifier. file_attr_options meets the requirements of BitmaskType.

Enumerator
none 
replace 

Replace existing permissions.

add 

Replace permissions with the bitwise OR of the argument and the current permissions.

remove 

Replace permissions with the bitwise AND of the negated argument and the current permissions.

◆ file_perms

enum asioext::file_perms
strong

Names for permissions.

This type represents file access permissions. file_perms meets the requirements of BitmaskType.

Enumerator
none 

No permissions are set.

owner_read 

S_IRUSR, Read permission, owner.

owner_write 

S_IWUSR, Write permission, owner.

owner_exec 

S_IXUSR, Execute/search permission, owner.

owner_all 

S_IRWXU, Read, write, execute/search by owner.

group_read 

S_IRGRP, Read permission, group.

group_write 

S_IWGRP, Write permission, group.

group_exec 

S_IXGRP, Execute/search permission, group.

group_all 

S_IRWXG, Read, write, execute/search by group.

others_read 

S_IROTH, Read permission, others.

others_write 

S_IWOTH, Write permission, others.

others_exec 

S_IXOTH, Execute/search permission, others.

others_all 

S_IRWXO, Read, write, execute/search by others.

all 

All users have read, write, and execute/search permissions.

Equivalent to owner_all | group_all | others_all

set_uid 

S_ISUID, Set-user-ID on execution.

set_gid 

S_ISGID, Set-group-ID on execution.

sticky_bit 

S_ISVTX,

  • 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
See also
http://en.wikipedia.org/wiki/Sticky_bit
create_default 

Default permissions for newly created files (like DEFFILEMODE).

Set to 0666 ( owner_read | owner_write | group_read | group_write | others_read | others_write) on all systems.

Note
Actual file permissions might differ, as these permissions are modified by the process' umask.
mask 

All valid permission bits

Equivalent to all | set_uid | set_gid | sticky_bit.

unknown 

Unknown permissions.