Advanced Programming in the UNIX® Environment
ptg10805159 Section 3.15 ioctlFunction 87 row in Figure3.13, but since theO_SYNCflag isn’t having the intended effect, the last ...
ptg10805159 88 File I/O Chapter 3 Theioctlfunction was included in the Single UNIX Specification only as an extension for dealin ...
ptg10805159 Section 3.16 /dev/fd 89 In the function call fd = open("/dev/fd/0", mode); most systems ignorethe specifiedmode,wher ...
ptg10805159 90 File I/O Chapter 3 3.17 Summary This chapter has described the basic I/O functions provided by the UNIX System. T ...
ptg10805159 Chapter 3 Exercises 91 3.6 If youopenafile for read–write with the append flag, can you stillreadfrom anywherein the ...
ptg10805159 This page intentionally left blank ...
ptg10805159 4 Files and Director ies 4.1 Introduction In the previous chapter we covered the basic functions that perform I/O. T ...
ptg10805159 94 Files and Directories Chapter 4 Given apathname,thestatfunction returns a structure of information about the name ...
ptg10805159 Section 4.3 File Types 95 Note that most members of thestatstructureare specified by a primitive system data type (s ...
ptg10805159 96 Files and Directories Chapter 4 MacroType of file S_ISREG() regular file S_ISDIR() directory file S_ISCHR() chara ...
ptg10805159 Section 4.3 File Types 97 ptr = "directory"; else if (S_ISCHR(buf.st_mode)) ptr = "character special"; else if (S_IS ...
ptg10805159 98 Files and Directories Chapter 4 File type Count Percentage regular file 415,803 79.77 % directory 62,197 11.93 sy ...
ptg10805159 Section 4.5 File Access Permissions 99 When we execute a program file, the effective user ID of the process is usual ...
ptg10805159 100 Files and Directories Chapter 4 usesoto mean other,not owner.We’ll use the termsuser,group,andother, to be consi ...
ptg10805159 Section 4.6 Ownership of New Files and Directories 101 The file access tests that the kernel performs each time a pr ...
ptg10805159 102 Files and Directories Chapter 4 FreeBSD 8.0 and Mac OS X 10.6.8 always copy the new file’s group ID from the dir ...
ptg10805159 Section 4.7 accessandfaccessatFunctions 103 Theflagargument can be used to change the behavior offaccessat.Ifthe AT_ ...
ptg10805159 104 Files and Directories Chapter 4 In this example, the set-user-ID program can determine that the real user cannot ...
ptg10805159 Section 4.8 umaskFunction 105 If we run this program, we can see how the permission bits have been set. $umask first ...
ptg10805159 106 Files and Directories Chapter 4 $umask first print the current file mode creation mask 002 $umask -S print the s ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf