FIND YOUR NEXT FEW LINES

Results for “File operations & paths”

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

946 snippets foundClear filters
Docker / ComposeCompose service options

Supply a non-secret configuration file

Docker / Compose: A Compose config mounts a declared file into the service.

Docker / Compose✓ Tested
GitBranches & recovery

Temporarily store tracked-file edits

Restore a clean working tree and then reapply your saved changes.

stash✓ Tested
GitInspecting the working tree

Test whether tracked working files changed

Git: A quiet diff returns status one for differences, so handle it in a conditional.

Git✓ Tested
GitGetting Started

Unstage a file while keeping its contents

Git: Unstage a file while keeping its contents inside the disposable repository created by the input setup.

Git✓ Tested
GitWorking tree & staging

Unstage a file without losing edits

Return a staged change to the working tree.

restore✓ Tested
CFile positioning & lifecycle

Use an automatically removed temporary file

C: tmpfile creates a binary update stream whose file is removed when closed.

C✓ Tested
Linux CommandsArchive integrity & packaging

Verify a file against a checksum manifest

Linux Commands: Use sha256sum -c with a manifest obtained from a trusted source.

Linux Commands✓ Tested
PythonJSON & CSV

Write a JSON file

Save a dictionary as readable, indented JSON while preserving Unicode characters.

json✓ Tested
CFiles

Write a text file

Open, write, and close a C file while checking every operation.

C✓ Tested
JavaScriptFiles & async

Write a UTF-8 file

Use the built-in Node.js filesystem API to save text.

JavaScript✓ Tested
Bash ScriptsInput streams & redirection

Write several messages through one file descriptor

Bash Scripts: Open a destination once and close the descriptor after writing.

Bash Scripts✓ Tested
Linux CommandsGetting Started

Write text to a new practice file

Linux Commands: Write text to a new practice file using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested