📄 creat.2
字号:
.th CREAT II 8/5/73.sh NAMEcreat \*- create a new file.sh SYNOPSIS(creat = 8.).br.ft Bsys creat; name; mode.br.ft R(file descriptor in r0).ft B.s3creat(name, mode).brchar *name;.ft R.sh DESCRIPTION.it Creatcreates a new file or prepares to rewrite an existingfile called .it name,given as the address of a null-terminated string.If the file did not exist, it is givenmode.it mode.See.it chmod(II) for theconstruction of the.it modeargument..s3If the file did exist, its mode and owner remain unchangedbut it is truncated to 0 length..s3The file is also opened for writing, and its file descriptoris returned (in r0)..s3The.it modegiven is arbitrary; it need not allowwriting.This feature is used by programs which deal with temporaryfiles of fixed names.The creation is done witha mode that forbids writing.Then if a secondinstance of the program attempts a.it creat,an error isreturned and the program knows that the name is unusablefor the moment..sh "SEE ALSO"write (II), close (II), stat (II).sh DIAGNOSTICSThe error bit(c-bit) may be set if: a needed directory is not searchable;the file does not exist and the directoryin which it is to be created is not writable; the filedoes exist and is unwritable;the file is a directory;there are already too many files open..s3From C, a \*-1 return indicates an error.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -