Results for “File operations & archives”
Small, practical examples. Search by task or narrow things down below.
Read text in bounded chunks
Read a C text file with fgets and a fixed buffer.
C✓ Tested
Read the current branch name
Git: show-current returns an empty string when HEAD is detached.
Git✓ Tested
Read the exact version currently staged
Git: The colon path syntax reads a blob from the index rather than from HEAD or the working file.
Git✓ Tested
Read the kind of command being invoked
PowerShell: CommandType distinguishes cmdlets from functions, aliases, and external applications.
PowerShell✓ Tested
Read the latest commit message
Git: Read the latest commit message inside the disposable repository created by the input setup.
Git✓ Tested
Read the upstream tracked by the current branch
Git: The upstream shorthand resolves the configured remote-tracking branch.
Git✓ Tested
Read values from an inserted row
Use RETURNING to retrieve an automatically assigned row ID.
RETURNING✓ Tested
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Receive a result from a goroutine
Receive a result from a goroutine using a complete Go program with explicit sample inputs.
Go✓ Tested
Reject a narrowing integer conversion
Reject a narrowing integer conversion in a complete Rust program using the standard library.
Rust✓ Tested
Reject an integer outside a byte’s range
Reject an integer outside a byte’s range using a complete Go program with explicit sample inputs.
Go✓ Tested
Reject NaN and infinite values
PowerShell: Double.IsFinite excludes numeric values unsuitable for ordinary bounded calculations.
PowerShell✓ Tested