FIND YOUR NEXT FEW LINES

Results for “File operations & archives”

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

947 snippets foundClear filters
CSmall algorithms & bit operations

Count set bits in an unsigned integer

C: Clearing the lowest set bit on each iteration counts only one iteration per set bit.

C✓ Tested
Bash ScriptsArray operations

Count the elements in an array

Bash Scripts: The array length form counts assigned elements, not characters in the first value.

Bash Scripts✓ 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
SQLBulk changes & set operations

Delete rows selected by a related table

SQL: A correlated EXISTS limits the delete to explicitly listed records.

SQL✓ Tested
SQL ServerBulk changes & set operations

Delete rows selected by a related table

SQL Server: A correlated EXISTS limits the delete to explicitly listed records.

SQL Server✓ Tested
PostgresBulk changes & set operations

Delete rows selected by a related table

Postgres: A correlated EXISTS limits the delete to explicitly listed records.

Postgres✓ Tested
SQLiteBulk changes & set operations

Delete rows selected by a related table

SQLite: A correlated EXISTS limits the delete to explicitly listed records.

SQLite✓ Tested
JavaScriptUTC date operations

Detect an invalid Date object

JavaScript: An invalid Date has a NaN time value.

JavaScript✓ Tested
TypeScriptUTC date operations

Detect an invalid Date object

TypeScript: An invalid Date has a NaN time value.

TypeScript✓ 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