Advanced Programming in the UNIX® Environment
ptg10805159 Section 4.20 futimens,utimensat,andutimesFunctions 127 •Iftimesis a non-null pointer and bothtv_nsecfields areset to ...
ptg10805159 128 Files and Directories Chapter 4 { int i, fd; struct stat statbuf; struct timespec times[2]; for (i = 1; i < a ...
ptg10805159 Section 4.21 mkdir,mkdirat,andrmdirFunctions 129 4.21 mkdir,mkdirat,and rmdirFunctions Directories arecreated with t ...
ptg10805159 130 Files and Directories Chapter 4 #include <unistd.h> int rmdir(const char *pathname); Returns: 0 if OK,−1 o ...
ptg10805159 Section 4.22 Reading Directories 131 The fdopendir function first appeared in version 4 of the Single UNIX Specifica ...
ptg10805159 132 Files and Directories Chapter 4 In SUSv4,nftwis included as part of the XSI option. Implementations areincluded ...
ptg10805159 Section 4.22 Reading Directories 133 #define FTW_DNR 3 /* directory that can’t be read */ #define FTW_NS 4/*file tha ...
ptg10805159 134 Files and Directories Chapter 4 fullpath[n] = 0; if ((dp = opendir(fullpath)) == NULL) /* can’t read directory * ...
ptg10805159 Section 4.23 chdir,fchdir,andgetcwdFunctions 135 To illustrate theftwandnftwfunctions, we have provided moregenerali ...
ptg10805159 136 Files and Directories Chapter 4 If we compile this program, call the executablemycd,and run it, we get the follo ...
ptg10805159 Section 4.24 Device Special Files 137 #include "apue.h" int main(void) { char *ptr; size_t size; if (chdir("/usr/spo ...
ptg10805159 138 Files and Directories Chapter 4 •Wecan usually access the major and minor device numbers through two macros defi ...
ptg10805159 Section 4.24 Device Special Files 139 if (S_ISCHR(buf.st_mode) || S_ISBLK(buf.st_mode)) { printf(" (%s) rdev = %d/%d ...
ptg10805159 140 Files and Directories Chapter 4 4.25 Summary of File Access Per mission Bits We’ve covered all the file access p ...
ptg10805159 Chapter 4 Exercises 141 system, and we’ve seen how to navigate the file system namespace. Athorough understanding of ...
ptg10805159 142 Files and Directories Chapter 4 4.15 Examine the archive formats used by the cpio( 1 ) and tar( 1 ) commands. (T ...
ptg10805159 5 StandardI/O Library 5.1 Introduction In this chapter, we describe the standardI/O library.This library is specifie ...
ptg10805159 144 StandardI/O Library Chapter 5 StandardI/O file streams can be used with both single-byte and multibyte (‘‘wide’’ ...
ptg10805159 Section 5.4 Buffering 145 5.3 StandardInput, StandardOutput, and StandardError Three streams arepredefined and autom ...
ptg10805159 146 StandardI/O Library Chapter 5 or (b) a line-buffered stream (that requires data to be requested from the kernel) ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf