Lines Matching +full:read +full:- +full:1
1 .\" Copyright (C) Caldera International Inc. 2001-2002. All rights reserved.
39 LOW-LEVEL I/O
86 .UC READ(5,...)
109 three files, with file descriptors 0, 1, and 2,
114 and writes file descriptors 1 and 2,
124 .P1
128 0 and 1
138 so long as it uses file 0 for input and 1 and 2 for output.
140 Read and Write
144 .UL read
152 .P1
153 n_read = read(fd, buf, n);
164 bytes remained to be read.
166 .UL read
171 .UL -1
178 The number of bytes to be read or written is quite arbitrary.
180 1,
195 .P1
196 #define BUFSIZE 512 /* best size for PDP-11 UNIX */
203 while ((n = read(0, buf, BUFSIZE)) > 0)
204 write(1, buf, n);
211 .UL read
216 .UL read
221 .UL read
233 .P1
240 return((read(0, &c, 1) > 0) ? c & CMASK : EOF);
249 .UL read
258 .UC PDP -11
265 .P1
276 n = read(0, buf, BUFSIZE);
279 return((--n >= 0) ? *bufp++ & CMASK : EOF);
288 read or write them.
303 .P1
317 is 0 for read, 1 for write, and 2 for read and write access.
320 .UL -1
331 or to re-write old ones.
332 .P1
340 .UL -1
364 controlling read, write and execute permission for
368 Thus a three-digit octal number
372 specifies read, write and execute permission for the owner,
373 and read and execute permission for the group and everyone else.
386 .P1
400 if ((f1 = open(argv[1], 0)) == -1)
401 error("cp: can't open %s", argv[1]);
402 if ((f2 = creat(argv[2], PMODE)) == -1)
405 while ((n = read(f1, buf, BUFSIZE)) > 0)
411 .P1
417 exit(1);
422 there is a limit (typically 15-25)
426 many files must be prepared to re-use
449 .UL read
455 a file can be read or written in any arbitrary order.
462 .P1
484 can be 0, 1, or 2 to specify that
493 .P1
497 .P1
512 .P1
513 get(fd, pos, buf, n) /* read n bytes from position pos */
519 return(read(fd, buf, n));
523 In pre-version 7
539 .UC PDP -11
555 as if it were 0, 1, or 2 respectively.
561 equal to 1 and moves to the desired byte within the block.
568 Usually they indicate an error by returning a value of \-1.
583 or because the user lacked permission to read it.