Results for “read file”
Small, practical examples. Search by task or narrow things down below.
Write and read binary bytes
Round-trip a byte buffer through a C binary file.
C✓ Tested
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Distinguish end-of-input from other errors
Distinguish end-of-input from other errors using a complete Go program with explicit sample inputs.
Go✓ Tested
Initialize shared data once
Initialize shared data once in a complete Rust program using the standard library.
Rust✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Move owned data into a worker
Move owned data into a worker in a complete Rust program using the standard library.
Rust✓ Tested
Protect shared mutable state with a mutex
Protect shared mutable state with a mutex in a complete Rust program using the standard library.
Rust✓ Tested
Send a value through a channel
Send a value through a channel in a complete Rust program using the standard library.
Rust✓ Tested
Share data through a named volume
Keep a file across two short-lived containers.
volume✓ Tested
Share immutable data with Arc
Share immutable data with Arc in a complete Rust program using the standard library.
Rust✓ Tested
Update an atomic counter
Update an atomic counter in a complete Rust program using the standard library.
Rust✓ Tested
Check available disk space
Show total, used, and available filesystem space for the current directory in human-readable units.
disk✓ Tested