FIND YOUR NEXT FEW LINES

Results for “File operations & binary data”

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

1473 snippets foundClear filters
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
C#JSON & binary formats

Read a big-endian binary integer

C#: Use BinaryPrimitives when the protocol byte order differs from or must not depend on the host.

C#✓ Tested
ReactAccessibility & events

Read a data attribute from the current target

Read a data attribute from the current target with a small React component and explicit browser behavior.

React✓ Tested
GitCommits & history

Read a file from a commit

Inspect committed content without changing your working copy.

show✓ Tested
GitGetting Started

Read a file from the latest commit

Git: Read a file from the latest commit inside the disposable repository created by the input setup.

Git✓ Tested
GitCommit history & revision selection

Read a file from the parent commit

Git: HEAD~1 names the first parent one generation before HEAD.

Git✓ Tested
C++Files & paths

Read a file line by line

Read C++ text lines without loading the whole file at once.

C++✓ Tested
Bash ScriptsLoops & decisions

Read a file without losing its last line

Handle spaces, backslashes, and a final line without a newline.

read lines✓ Tested
C++Files & paths

Read a filename extension

Extract the final extension from a C++ filesystem path.

C++✓ Tested
PythonJSON & CSV

Read a JSON file

Load a JSON document from disk into Python objects using an explicitly selected text encoding.

json✓ Tested
Docker / ComposeCompose service options

Read a secret from a mounted file

Docker / Compose: Compose secrets make a file available under /run/secrets.

Docker / Compose✓ Tested
PythonFiles & paths

Read a text file

Open a UTF-8 text file and read its contents. A context manager closes the file automatically, even if reading fails.

file✓ Tested