FIND YOUR NEXT FEW LINES

Results for “File operations & binary data”

Small, practical examples. Search by task or narrow things down below.

1473 snippets foundClear filters
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
JavaQueues & collection operations

Locate a value in a sorted array

Java: Use Arrays.binarySearch only after establishing ascending order.

Java✓ Tested
C#File operations & paths

Replace a path extension

C#: Path.ChangeExtension transforms a path string without moving or creating a file.

C#✓ Tested
C#Collections & data structures

Search a sorted array efficiently

C#: Array.BinarySearch requires an array sorted with the same comparison rules.

C#✓ Tested
C++Filesystem operations

Set owner-only read and write permissions

C++: Replace ordinary permission bits with the requested owner permissions.

C++✓ Tested
RustThreads & shared ownership

Borrow local data in a scoped thread

Borrow local data in a scoped thread in a complete Rust program using the standard library.

Rust✓ Tested
RustErrors & optional values

Chain operations that may return None

Chain operations that may return None in a complete Rust program using the standard library.

Rust✓ Tested
HTMLForm behavior

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
RustParsing & byte data

Detect invalid UTF-8 data

Detect invalid UTF-8 data in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeImage management

Export a container filesystem into a new image

Docker / Compose: export contains filesystem data; import creates a new image from it.

Docker / Compose✓ Tested
RustThreads & shared ownership

Initialize shared data once

Initialize shared data once in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeNetworks & volume metadata

Keep scratch data only for the container lifetime

Docker / Compose: Separate tmpfs mounts do not share data between container runs.

Docker / Compose✓ Tested