📄 wr
字号:
@c ----------------------------------------------------------------------
@node write, io
@heading @code{write}
@subheading Syntax
@example
#include <osfcn.h>
int write(int file, const void *buffer, unsigned count);
@end example
@subheading Description
This function writes @var{count} bytes from @var{buffer} to @var{file}.
It returns the number of bytes actually written. It will return zero at
end-of-file, and may return less than @var{count} even under valid
conditions.
Note that if @var{file} is a text file, @code{write} may write more
bytes than it reports.
@subheading Return Value
The number of bytes written, zero at EOF, or -1 on error.
@subheading Example
@example
write(fd, "hello", 5);
@end example
@c ----------------------------------------------------------------------
@node writecr, io
@heading @code{writecr}
@subheading Syntax
@example
int write(int file, const void *buffer, unsigned count);
@end example
@subheading Description
This is just like @code{write} (@pxref{write}) except that the Ctrl-M
characters are inserted before each Ctrl-J character to convert from
Unix-style text lines to DOS-style text lines when writing to a binary
file.
@subheading Return Value
The number of bytes written, zero at EOF, or -1 on error.
@subheading Example
@example
writecr(fd, "hello\n", 6);
@end example
@c ----------------------------------------------------------------------
@node writev, io
@heading @code{writev}
@subheading Syntax
@example
#include <sys/uio.h>
int writev(int handle, struct iovec *iov, int count);
@end example
@subheading Description
This is just like @code{readv} (@pxref{readv}), except that it writes
instead of reading.
@subheading Return Value
The number of bytes written.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -