Results for “file check”
Small, practical examples. Search by task or narrow things down below.
Write UTF-8 text to a file
Save a string without adding an extra newline.
Set-Content✓ Tested
Append a line while keeping earlier content
PowerShell: Add-Content appends using an explicitly selected encoding.
PowerShell✓ Tested
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Change a path’s extension
Change a path’s extension in a complete Rust program using the standard library.
Rust✓ Tested
Choose Bash with pipefail for build commands
Docker / Compose: SHELL changes the interpreter for subsequent shell-form instructions.
Docker / Compose✓ Tested
Clean up a temporary directory automatically
Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.
Python✓ Tested
Combine a stable entrypoint with default arguments
Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.
Docker / Compose✓ Tested
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
Copy a directory’s contents into an image
Docker / Compose: A directory COPY includes its children at the destination.
Docker / Compose✓ Tested
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
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
Create a nested directory tree
Create a nested directory tree in a complete Rust program using the standard library.
Rust✓ Tested