This patch adds the file_writer header, which just provides a wrapper
for File->write, as well as fprintf to use it. There are no unit tests
for file_writer since it's too simple to need them, but fprintf does
have a simple test of writing to a file.
Details
Details
- Reviewers
sivachandra lntue - Commits
- rGba7e1cddda62: [libc] add fprintf and file_writer
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/stdio/printf_core/file_writer.h | ||
---|---|---|
24 | Is it OK to ignore the return value? For example, if file were read only, then write would fail. Shouldn't that be reflected in the fprintf return value? |
Comment Actions
add handling for FILE errors
libc/src/stdio/printf_core/file_writer.h | ||
---|---|---|
24 | I've added a check of the file's ferror status in fprintf and a section of the test to check that it works. |
Is it OK to ignore the return value? For example, if file were read only, then write would fail. Shouldn't that be reflected in the fprintf return value?