FIND YOUR NEXT FEW LINES

Results for “read file”

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

1171 snippets foundClear filters
C++Filesystem operations

Write and read bytes without text conversion

C++: Use binary stream modes and check each I/O operation before consuming its result.

C++✓ Tested
C#File operations & paths

Write and read raw bytes

C#: Use the byte-oriented file APIs when no text encoding should be applied.

C#✓ Tested
RustThreads & shared ownership

Borrow local data in a scoped thread

Borrow local data in a scoped thread in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellHashtables & object records

Check for a hashtable key before reading it

PowerShell: ContainsKey distinguishes a missing key from a key whose value happens to be null.

PowerShell✓ Tested
Bash ScriptsFiles & reliability

Check that a file is present and nonempty

Test file content availability before reading it.

file check✓ Tested
CFile positioning & lifecycle

Copy a file in bounded binary chunks

C: Check read, write, and close errors while copying without loading the entire file.

C✓ Tested
C#File operations & paths

Copy a file without overwriting

C#: File.Copy defaults to refusing a destination that already exists.

C#✓ Tested
JavaFile operations & binary data

Copy a file without replacing an existing destination

Java: Files.copy fails if the destination already exists unless replacement is explicitly enabled.

Java✓ Tested
C++Filesystem operations

Copy a file without replacing an existing destination

C++: The default copy_file policy refuses to overwrite an existing destination.

C++✓ Tested
GitBranches & ancestry

Delete an already merged practice branch

Git: The lowercase -d option refuses to delete an unmerged branch in ordinary use.

Git✓ Tested
C++Filesystem operations

Delete one known scratch file

C++: filesystem::remove reports whether an item was removed and also supports empty directories.

C++✓ Tested
GoGetting Started

Format a readable status message

Format a readable status message using a complete Go program with explicit sample inputs.

Go✓ Tested