?? creat.2
字號:
.TH CREAT 2 .SH NAMEcreat \- create a new file.SH SYNOPSIS.B creat(name, mode).br.B char *name;.SH DESCRIPTION.I Creatcreates a new file or prepares to rewrite an existingfile called .I name,given as the address of a null-terminated string.If the file did not exist, it is givenmode.IR mode ,as modified by the process's mode mask (see.IR umask (2)).Also see.IR chmod (2)for theconstruction of the.I modeargument..PPIf the file did exist, its mode and owner remain unchangedbut it is truncated to 0 length..PPThe file is also opened for writing, and its file descriptoris returned..PPThe.I 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.I creat,an error isreturned and the program knows that the name is unusablefor the moment..SH "SEE ALSO"write(2), close(2), chmod(2), umask (2).SH DIAGNOSTICSThe value \-1 is returned 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..SH ASSEMBLER(creat = 8.).br.B sys creat; name; mode.br(file descriptor in r0)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -