File: getstatus.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 (51 lines) | stat: -rw-r--r-- 2,154 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
The tt(std::path) free functions tt(status) and tt(symlink_status)
(cf. section ref(FREEFS)) return the tt(file_status) of file system entries.

The following functions provide specific information about the status of
file system entries:

COMMENT(
    The tt(filesystem) functions tt(status) and tt(symlink_status) 
retrieve or change statuses of file system entries. These
functions may be called with a final (optional) tt(error_code)
argument which is assigned an appropriate error code if they cannot perform
their tasks. If the argument is omitted the members throw exceptions if they
cannot perform their tasks
END)

    itemization(
    itht(status_known)(bool status_known(file_status const &status))
       returns tt(true) if tt(status) refers to a determined status
        (tt(status) itself may indicate that the entity referred to by
        tt(status) does not exist). One way of receiving tt(false) is by
        passing it a default status object: tt(status_known(file_status{}));

    itt(bool is_WHATEVER(file_status status)), 
       replacing tt(WHATEVER) by the requested file type, returns tt(true) if
        tt(status) refers to an entry of the specified type.
    )

These following tt(is_WHATEVER) functions are available:
    centertbl(ll)(\
    tline()()\
    tr(xcell(2)(is_WHATEVER(file_status) ))\
    tr(tlc()(Function)tlc()(Meaning))\
    tline()()\
    rowtwo(is_block_file)('entry' is a block device)
    rowtwo(is_character_file)('entry' is a character device)
    rowtwo(is_directory)('entry' is a directory)
    rowtwo(is_empty)    ('entry' is an empty file or directory)
    rowtwo(is_fifo)     ('entry' is a named pipe)
    rowtwo(is_other)    ('entry' is not a directory,nl()
                          regular file or symlink)
    rowtwo(is_regular_file)('entry' is a regular file)
    rowtwo(is_socket)   ('entry' is a named socket)
    rowtwo(is_symlink)  ('entry' is a symbolic link)
    tline()()\
    )

    Here is a small program showing how file statuses can be obtained and
displayed (cf. sections ref(PATH) and (for the em(map)) section ref(MAP)):
    verbinsert(-s4 //demo examples/statusknown.cc)