FileWrite
Description
Write up to n bytes from buf. Same short-write semantics as FileRead.
Success
Returns the number of bytes written (>= 0).
Failure
Returns -1 on error.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:516:
}
if (ok && out.length > 0 && FileWrite(stream, out.data, out.length) != (i64)out.length) {
LOG_ERROR("Failed to write formatted output");
ok = false;- In
Log.c:57:
File out = (type == LOG_MESSAGE_TYPE_INFO) ? FileFromFd(1) : FileFromFd(2);
(void)FileWrite(&out, full.data, full.length);
if (type == LOG_MESSAGE_TYPE_FATAL) {- In
Log.c:67:
Str trace = StrInit(a);
FormatStackTrace(&trace, frames, n, a);
(void)FileWrite(&out, trace.data, trace.length);
StrDeinit(&trace);
}- In
File.c:263:
}
i64 FileWrite(File *f, const void *buf, u64 n) {
if (!FileIsValid(f) || !buf) {
return -1;
Last updated on