File: filestatus.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (156 lines) | stat: -rw-r--r-- 5,647 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
File system entries (represented by tt(path) objects, cf. section ref(PATH)
below), have attributes: permissions (e.g., the owner may modify an entry),
and types (like files, directories, and soft-links).  Those attributes are
defined in the class tt(std::filesystem::file_status).

bf(Types):

hi(file_type)
Defined in the tt((std::filesystem) enum class file_type).

    centertbl(ll)(\
    tline()()\
    tr(xcell(2)(std::filesystem::file_type))\
    tr(tlc()(Type)tlc()(Meaning))\
    tline()()\
    rowtwo(not_found (= -1))
                (the file system entry was not found+nl()
                (not considered an error))
    rowtwo(none)(the file status has not yet been evaluated+nl()
                 or an error occurred when evaluating the status)
    rowtwo(regular)(a regular file)
    rowtwo(directory)(a directory)
    rowtwo(symlink)(a symbolic link)
    rowtwo(block)(a block device)
    rowtwo(character)(a character device)
    rowtwo(fifo)( a named pipe)
    rowtwo(socket)(a socket file)
    rowtwo(unknown)(an unknown file type)
    tline()()\
    )


bf(Permissions):

hi(perms)
Defined in the tt((std::filesystem) enum class perms). 

The enumeration's symbols were defined to make their meanings more descriptive
than the constants defined in the tthi(sys/stat.h) header file, but their
values are identical. The tt(enum class perms) supports all bitwise operators.


    centertbl(lrll)(\
    tline()()\
    tr(xcell(4)(std::filesystem::perms))\
    tr(cell(Symbol+nbsp(2))cell(Value)cell(sys/stat.h)tlc()(Meaning))\
    tline()()\
    rowfour(tt(none))(tt(0000))(nbsp(3)tt(-)tt(-)tt(-)) 
            (No permission bits were set)
    rowfour(tt(owner_read))(tt(0400))(tt(S_IRUSR))
            (File owner has read permission)
    rowfour(tt(owner_write))(tt(0200))(tt(S_IWUSR))
            (File owner has write permission)
    rowfour(tt(owner_exec))(tt(0100))(tt(S_IXUSR))
            (File owner has execute/search+nl()
            permissions)
    rowfour(tt(owner_all))(tt(0700))(tt(S_IRWXU))
            (File owner has read, write, and+nl()
             execute/search permissions)
    rowfour(tt(group_read))(tt(0040))(tt(S_IRGRP))
            (The file's group has read permission)
    rowfour(tt(group_write))(tt(0020))(tt(S_IWGRP))
            (The file's group has write permission)
    rowfour(tt(group_exec))(tt(0010))(tt(S_IXGRP))
            (The file's group has execute/search+nl()
            permissions)
    rowfour(tt(group_all))(tt(0070))(tt(S_IRWXG))
            (The file's group has read, write, and+nl()
            execute/search permissions)
    rowfour(tt(others_read))(tt(0004))(tt(S_IROTH))
            (Other users have read permission)
    rowfour(tt(others_write))(tt(0002))(tt(S_IWOTH))
            (Other users have write permission)
    rowfour(tt(others_exec))(tt(0001))(tt(S_IXOTH))
            (Other users have execute/search+nl()
             permissions)
    rowfour(tt(others_all))(tt(0007))(tt(S_IRWXO))
            (Other users have read, write, and nl()
            execute/search permissions)
    rowfour(tt(all))(tt(0777))(nbsp(3)tt(-)tt(-)tt(-))
            (All users have read, write, and+nl()
            execute/search permissions)
    rowfour(tt(set_uid))(tt(04000))(tt(S_ISUID))
            (Set user ID to file owner user ID on+nl()
            execution)
    rowfour(tt(set_gid))(tt(02000))(tt(S_ISGID))
            (Set group ID to file's user group ID on+nl()
             execution)
    rowfour(tt(sticky_bit))(tt(01000))(tt(S_ISVTX))
            (POSIX XSI specifies that when set on a+nl()
            directory only file owners may delete+nl()
            files even if the directory is writeable+nl()
             by others (used, e.g., with tt(/tmp)))
    rowfour(tt(mask))(tt(07777))(nbsp(3)tt(-)tt(-)tt(-))
            (All valid permission bits.)
    tline()()\
    )


bf(Perm_options):

hi(perm_options)
The tt((std::file_system) enum class perm_options) specifies the way file
system entries are modified

    centertbl(ll)(\
    tline()()\
    tr(xcell(2)(std::filesystem::perm_options))\
    tr(tlc()(Value)tlc()(Meaning))\
    tline()()\
    rowtwo(replace)(current permisions are replaced new permissions)
    rowtwo(remove)(the specified permissions are removed from the+nl()
                   file system entry's current permissions)
    rowtwo(nofollow)
                (when the current file system entry refers+nl()
                to a symbolic link the permissions of the+nl()
                symbolic link itself are updated)
    tline()()\
    )

bf(Constructors):

    itemization(
    itt(explicit file_status(file_type type = file_type::none,
                         perms permissions = perms::unknown))
    )
    Copy and move constructors and assignment operators are avaialble;

bf(Members):

    itemization(
    itht(permissions)(perms permissions() const) 
        returns the permissions of the file system entry represented by the
        tt(file_status) object.nl()
        Refer to section ref(FREEFS) for the function tt(permissions)
        changing the permissions of a file system entry; 

COMMENT(
    itt(void permissions(perms newPerms [, perm_options opts] 
                        [, error_code &ec])) 
        modifies the permissions of the file system entry to which the
        tt(file_status) object refers; 
END)

    itht(type)(file_type type() const)
       returns the type  of the file system entry to which the 
        tt(file_status) object refers;

    itt(void type(file_type type))
       changes the type of the file system entry to which the tt(file_tatus)
        object refers.
    )