]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/stream
authsrv(6): fix arrows
[plan9front.git] / sys / man / 3 / stream
1 .TH STREAM 3 
2 .SH NAME
3 stream \- fast sequential file access
4 .SH SYNOPSIS
5 .nf
6 .B bind #ΒΆ /fd
7
8 .B /fd/0stream
9 .B /fd/1stream
10 \&...
11 .fi
12 .SH DESCRIPTION
13 The
14 .I stream
15 device serves a one-level directory containing files of the form
16 .IR N stream
17 where
18 .I N
19 is a file descriptor of the current process.
20 .PP
21 An
22 .IR open (2)
23 returns a stream file descriptor connected to the original file
24 refered to by the file descriptor
25 .IR N .
26 When a stream was opend for reading, the device will start
27 continuously reading the file in the background until it reaches
28 the end of the file. A
29 .IR read (2)
30 on the stream consumes the prefetched data in sequential order.
31 .PP
32 When a stream is opend for writing, writes to the stream will
33 return immidiately without waiting for the data to be written
34 to the file. A zero-length write can be used to wait for the
35 buffered data to drain and return any previous write errors.
36 .SH SEE ALSO
37 .IR dup (3),
38 .IR pipe (3)
39 .SH SOURCE
40 .B /sys/src/9/port/devstream.c