Results for “file”
Small, practical examples. Search by task or narrow things down below.
Add a forgotten file to the latest unpublished commit
Git: Stage the missing file before amending without changing the message.
Git✓ Tested
Append a line to a file
Add a new line to the end of a text file without replacing its existing contents. Append mode also creates the file if it does not exist.
file✓ Tested
Append a line to a practice file
Linux Commands: Append a line to a practice file using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Append a stream to a log file
Linux Commands: Use tee -a to preserve existing log contents.
Linux Commands✓ Tested
Append text to a file
Open a C++ stream in append mode and verify the write.
C++✓ Tested
Append text to a file
Use append mode in C without replacing the existing file.
C✓ Tested
Append to a file without truncating it
Append to a file without truncating it in a complete Rust program using the standard library.
Rust✓ Tested
Archive filenames safely with null delimiters
Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.
Linux Commands✓ Tested
Build a portable file path
Combine directory and filename using the platform separator.
Join-Path✓ Tested
Calculate a file’s SHA-256 digest
PowerShell: Get-FileHash hashes bytes without requiring the caller to load the whole file.
PowerShell✓ Tested
Check a filename suffix
Java: Use endsWith for a case-sensitive literal suffix test.
Java✓ Tested
Check a literal filename suffix
C: Check lengths before subtracting so a short input cannot produce an invalid pointer.
C✓ Tested