Results for “Filesystem operations”
Small, practical examples. Search by task or narrow things down below.
Visit files recursively
Java: Close the stream returned by Files.walk and sort relative paths for stable output.
Java✓ Tested
Write and read binary bytes
Java: Use the byte-oriented Files methods when text encoding should not be involved.
Java✓ Tested
Write and read raw bytes
C#: Use the byte-oriented file APIs when no text encoding should be applied.
C#✓ Tested
Add and remove values at both ends
C++: Deque supports efficient end operations without requiring contiguous storage.
C++✓ Tested
Check any and all stream elements
Java: Use short-circuiting match operations for predicates over a Java collection.
Java✓ Tested
Check available disk space
Show total, used, and available filesystem space for the current directory in human-readable units.
disk✓ Tested
Choose a local file through a labeled control
HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.
HTML✓ Tested
Create nested directories
Use C++17 filesystem to create a directory tree.
C++✓ Tested
Give a read-only service writable scratch space
Docker / Compose: A tmpfs mount provides temporary storage independent of the root filesystem.
Docker / Compose✓ Tested
Measure a small seekable binary file
C: Seek to the end and inspect ftell, checking both operations for errors.
C✓ Tested
Observe cancellation through a token
C#: A cancellation token is cooperative; operations must check it or accept it as an argument.
C#✓ Tested
Read a filename extension
Extract the final extension from a C++ filesystem path.
C++✓ Tested