open.2
来自「UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱」· 2 代码 · 共 51 行
2
51 行
.th OPEN II 8/5/73.sh NAMEopen \*- open for reading or writing.sh SYNOPSIS(open = 5.).br.ft Bsys open; name; mode.br.ft R(file descriptor in r0).s3.ft Bopen(name, mode).brchar *name;.ft R.sh DESCRIPTION.it Openopens the file.it namefor reading(if.it modeis 0),writing (if.it modeis 1) or for both reading and writing(if.it modeis 2)..it Nameis the address of a string of ASCII characters representinga path name, terminated by a null character..s3The returned file descriptor should be saved for subsequent callsto.it read,.it write,and.it close..sh "SEE ALSO"creat (II), read (II), write (II), close (II).sh DIAGNOSTICSThe error bit(c-bit) is set if the file does not exist,if one of the necessary directoriesdoes not exist or is unreadable, if the file is notreadable (resp. writable), or if too many files are open.From C, a \*-1 value is returned on an error.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?