FIND YOUR NEXT FEW LINES

Results for “File operations & paths”

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

946 snippets foundClear filters
RustVectors & slices

Split a slice into two parts

Split a slice into two parts in a complete Rust program using the standard library.

Rust✓ Tested
GoStrings & text

Split on repeated whitespace

Split on repeated whitespace using a complete Go program with explicit sample inputs.

Go✓ Tested
RustStrings & Unicode

Split on Unicode whitespace

Split on Unicode whitespace in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeContainer lifecycle

Start an existing container and attach to its output

Docker / Compose: create records the command; start with attach runs that existing container.

Docker / Compose✓ Tested
GitStashing selected work

Stash only the staged changes

Git: The staged option saves index changes while keeping unrelated unstaged edits.

Git✓ Tested
GitStashing selected work

Stash unstaged work while leaving staged edits available

Git: Keep-index preserves the staged state for testing or committing while stashing the rest.

Git✓ Tested
Docker / ComposeContainer lifecycle

Stop a running container gracefully

Docker / Compose: stop sends the configured stop signal and waits before forcing termination.

Docker / Compose✓ Tested
RustErrors & optional values

Stop collecting when parsing fails

Stop collecting when parsing fails in a complete Rust program using the standard library.

Rust✓ Tested
C++Containers & compound values

Store and inspect a fixed set of bits

C++: bitset offers named operations and a readable binary representation.

C++✓ Tested
RustFunctions & data types

Store data in an enum variant

Store data in an enum variant in a complete Rust program using the standard library.

Rust✓ Tested
RustNumbers & durations

Subtract durations without underflow

Subtract durations without underflow in a complete Rust program using the standard library.

Rust✓ Tested
GitInspecting the working tree

Summarize added and removed lines numerically

Git: Numstat provides tab-separated counts suitable for processing.

Git✓ Tested