19 #define S_IFSOCK 0xC000
20 #define S_IFLNK 0xA000
21 #define S_IFREG 0x8000
22 #define S_IFBLK 0x6000
23 #define S_IFDIR 0x4000
24 #define S_IFCHR 0x2000
25 #define S_IFIFO 0x1000
31 #define S_ISTYPE(mode, mask) (((mode) & S_IFMT) == (mask))
32 #define S_ISSOCK(mode) (S_ISTYPE(mode, S_IFSOCK))
33 #define S_ISLNK(mode) (S_ISTYPE(mode, S_IFLNK))
34 #define S_ISREG(mode) (S_ISTYPE(mode, S_IFREG))
35 #define S_ISBLK(mode) (S_ISTYPE(mode, S_IFBLK))
36 #define S_ISDIR(mode) (S_ISTYPE(mode, S_IFDIR))
37 #define S_ISCHR(mode) (S_ISTYPE(mode, S_IFCHR))
38 #define S_ISFIFO(mode) (S_ISTYPE(mode, S_IFIFO))
44 #define S_ISUID 0x0800
45 #define S_ISGID 0x0400
46 #define S_ISVTX 0x0200
47 #define S_IRWXU 0x01C0
48 #define S_IRUSR 0x0100
49 #define S_IWUSR 0x0080
50 #define S_IXUSR 0x0040
51 #define S_IRWXG 0x0038
52 #define S_IRGRP 0x0020
53 #define S_IWGRP 0x0010
54 #define S_IXGRP 0x0008
55 #define S_IRWXO 0x0007
56 #define S_IROTH 0x0004
57 #define S_IWOTH 0x0002
58 #define S_IXOTH 0x0001
Defines the structure used by the functiosn fstat(), lstat(), and stat().
unsigned int mode_t
The type of mode.
Definition: stddef.h:49
Data structure which contains information about a file.
Definition: stat.h:16
int mkdir(const char *path, mode_t mode)
Creates a new directory at the given path.
int fstat(int fd, stat_t *buf)
Retrieves information about the file at the given location.
int rmdir(const char *path)
Removes the given directory.
int stat(const char *path, stat_t *buf)
Retrieves information about the file at the given location.
int creat(const char *path, mode_t mode)
Creates a new file or rewrite an existing one.