Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
File

🟩 Synchronous Disk File I/O

File library allows synchronous I/O operations on files and pipes.

Dependencies

Statistics

Type Lines Of Code Comments Sum
Headers 100 132 232
Sources 592 107 699
Sum 692 239 931

Features

SC::FileDescriptor [UniqueHandleDeclaration2Snippet]
SC::FileDescriptor::read Reads bytes at offset into user supplied span.
SC::FileDescriptor::write Writes bytes at offset from start of the file descriptor.
SC::FileDescriptor::seek Changes the current position in the file descriptor, if seekable.
SC::FileDescriptor::open Opens a file descriptor handle from a file system path.
SC::FileDescriptor::readUntilEOF Reads into a given dynamic buffer until End of File (EOF) is signaled.
SC::PipeDescriptor Read / Write pipe (Process stdin/stdout and IPC communication)
SC::PipeDescriptor::readPipe The read side of the pipe.
SC::PipeDescriptor::writePipe The write side of the pipe.

Status

🟩 Usable
This library has a relatively limited scope and it should not need many additional features compared to now.
Will consider bumping to Complete in the future.

Blog

Some relevant blog posts are:

Description

SC::FileDescriptor object can be created by SC::FileDescriptor::open-ing a path on file system and it can be SC::FileDescriptor::read or SC::FileDescriptor::write.
Also non-blocking mode can be controlled with SC::FileDescriptor::setBlocking.
A file can be marked as inheritable with SC::FileDescriptor::setInheritable so that in can be accessed by child processes. SC::PipeDescriptor creates a pipe for InterProcess communication.
A pipe has read and write SC::FileDescriptor endpoints and it's used by Process library to redirect standard input, output or error to other processes.
It can also be used to read or write the standard input, output or error from current process into a binary buffer or a string (as done by SC::ProcessChain::readStdOutUntilEOFSync or other similar methods).

Open, read and write to/from a file descriptor (like a file or pipe).

Roadmap

🟦 Complete Features:

  • None for now

💡 Unplanned Features:

  • None for now