<filesystem> enumerations

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at <filesystem> enumerations.

This topic documents the enums in the filesystem header.

Header: <experimental/filesystem>

Namespace: std::experimental::filesystem::copy_option

An enumeration of bitmask values that is used with copy and copy_file functions to specify behavior.

class copy_options {
none = 0,
skip_existing = 1,
overwrite_existing = 2,
update_existing = 4,
recursive = 8,
copy_symlinks = 16,
skip_symlinks = 32,
directories_only = 64,
create_symlinks = 128,
create_hard_links = 256
};

Values

NameDescription
nonePerform the default behavior for the operation.
skip_existingDo not copy if the file already exists, do not report an error.
overwrite_existingOverwrite the file if it already exists.
update_existingOverwrite the file if it already exists and is older than the replacement.
recursiveRecursively copy subdirectories and their contents.
copy_symlinksCopy symbolic links as symbolic links, instead of copying the files they point to.
skip_symlinksIgnore symbolic links.
directories_onlyOnly iterate over directories, ignore files.
create_symlinksMake symbolic links instead of copying files. An absolute path must be used as the source path unless the destination is the current directory.
create_hard_linksMake hard links instead of copying files.

Specifies whether to follow symbolic links to directories or to ignore them.

class directory_options {
none = 0,
follow_directory_symlink };

NameDescription
noneDefault behavior: ignore symbolic links to directories. Permission denied is an error.
follow_directory_symlinkTreat symbolic links to directories as actual directories.

An enumeration for file types. The supported values are regular, and directory, not_found and unknown.

enum file_type;  

NameValueDescription
not_found-1Represents a file that does not exist.
none0Represents a file that has no type attribute. (Not supported.)
regular1Represents a conventional disk file.
directory2Represents a directory.
symlink3Represents a symbolic link. (Not supported.)
block4Represents a block-special file on UNIX-based systems. (Not supported.)
character5Represents a character-special file on UNIX-based systems. (Not supported.)
fifo6Represents a FIFO file on UNIX-based systems. (Not supported.)
socket7Represents a socket on UNIX based systems. (Not supported.)
unknown8Represents a file whose status cannot be determined.

Flags for file permissions. The supported values are essentially “readonly” and all. For a readonly file, none of the *_write bits are set. Otherwise the all bit (0x0777) is set.

class perms {// names for permissions none = 0, owner_read = 0400, // S_IRUSR owner_write = 0200, // S_IWUSR owner_exec = 0100, // S_IXUSR owner_all = 0700, // S_IRWXU group_read = 040, // S_IRGRP group_write = 020, // S_IWGRP group_exec = 010, // S_IXGRP group_all = 070, // S_IRWXG others_read = 04, // S_IROTH others_write = 02, // S_IWOTH others_exec = 01, // S_IXOTH others_all = 07, // S_IRWXO all = 0777, set_uid = 04000, // S_ISUID set_gid = 02000, // S_ISGID sticky_bit = 01000, // S_ISVTX mask = 07777, unknown = 0xFFFF, add_perms = 0x10000, remove_perms = 0x20000, resolve_symlinks = 0x40000 };

Header Files Reference
<filesystem>

Show: