Results for “File operations & archives”
Small, practical examples. Search by task or narrow things down below.
Unstage a file without losing edits
Return a staged change to the working tree.
restore✓ Tested
Use an automatically removed temporary file
C: tmpfile creates a binary update stream whose file is removed when closed.
C✓ Tested
Verify a file against a checksum manifest
Linux Commands: Use sha256sum -c with a manifest obtained from a trusted source.
Linux Commands✓ Tested
Write a JSON file
Save a dictionary as readable, indented JSON while preserving Unicode characters.
json✓ Tested
Write a text file
Save a string to a UTF-8 text file and close the file automatically when the write finishes.
file✓ Tested
Write a text file
Write a C# string to a UTF-8 file.
C#✓ Tested
Write a text file
Write and close a C++ output file while checking stream failure.
C++✓ Tested
Write a text file
Open, write, and close a C file while checking every operation.
C✓ Tested
Write a UTF-8 file
Write a Java string to a file using an explicit text encoding.
Java✓ Tested
Write a UTF-8 file
Use the built-in Node.js filesystem API to save text.
JavaScript✓ Tested
Write and read a UTF-8 file
Write and read a UTF-8 file using a complete Go program with explicit sample inputs.
Go✓ Tested
Write and read a UTF-8 file
Write and read a UTF-8 file in a complete Rust program using the standard library.
Rust✓ Tested