FIND YOUR NEXT FEW LINES

Results for “open file”

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

1107 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
Docker / ComposeDockerfile patterns

Combine a stable entrypoint with default arguments

Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.

Docker / Compose✓ Tested
Linux CommandsFiles & permissions

Copy a directory while preserving attributes

Linux Commands: Use cp -a for a recursive local copy that preserves links and ordinary file attributes.

Linux Commands✓ Tested
Docker / ComposeDockerfile patterns

Copy a directory’s contents into an image

Docker / Compose: A directory COPY includes its children at the destination.

Docker / Compose✓ Tested
GoFiles & paths

Copy a stream and count its bytes

Copy a stream and count its bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
Docker / ComposeDockerfile patterns

Copy an artifact from an earlier build stage

Docker / Compose: A named stage can produce an artifact without copying its other files.

Docker / Compose✓ Tested
RustFiles & paths

Create a nested directory tree

Create a nested directory tree in a complete Rust program using the standard library.

Rust✓ Tested
GoFiles & paths

Create nested directories

Create nested directories using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsFinding & selecting files

Exclude a directory from a recursive search

Linux Commands: Use prune to avoid descending into generated dependencies.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Extract a parent directory from a path

Linux Commands: Use dirname without needing the path to exist.

Linux Commands✓ Tested
Docker / ComposeExecution & file transfer

Inspect changes to a container’s writable layer

Docker / Compose: diff marks added, changed, and deleted filesystem paths.

Docker / Compose✓ Tested
GoFiles & paths

Join portable path components

Join portable path components using a complete Go program with explicit sample inputs.

Go✓ Tested