Results for “File operations & archives”
Small, practical examples. Search by task or narrow things down below.
Initialize a map entry only when absent
Java: Use computeIfAbsent when creating a collection for a new key.
Java✓ Tested
Insert only keys absent from a destination
SQL: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQL✓ Tested
Insert only keys absent from a destination
SQL Server: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQL Server✓ Tested
Insert only keys absent from a destination
Postgres: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
Postgres✓ Tested
Insert only keys absent from a destination
SQLite: NOT EXISTS supports a set-based missing-row insert in a single-writer example.
SQLite✓ Tested
Inspect changes to a container’s writable layer
Docker / Compose: diff marks added, changed, and deleted filesystem paths.
Docker / Compose✓ Tested
Join array items with a one-character separator
Bash Scripts: A local IFS controls the separator used by the quoted star expansion.
Bash Scripts✓ Tested
Join portable path components
Join portable path components using a complete Go program with explicit sample inputs.
Go✓ Tested
Keep exec-form arguments literal
Docker / Compose: JSON exec form does not expand shell environment variables.
Docker / Compose✓ Tested
Limit a search to the immediate directory
Linux Commands: Use maxdepth with type f to exclude nested files and directories.
Linux Commands✓ Tested
List paths saved in the latest commit
Git: List paths saved in the latest commit inside the disposable repository created by the input setup.
Git✓ Tested
Locate a value in a sorted array
Java: Use Arrays.binarySearch only after establishing ascending order.
Java✓ Tested