FIND YOUR NEXT FEW LINES

Results for “save file”

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

1970 snippets foundClear filters
CFile positioning & lifecycle

Read a stream again from its beginning

C: rewind returns a seekable stream to offset zero and clears its error and EOF indicators.

C✓ Tested
CFile positioning & lifecycle

Read characters without confusing EOF with a byte

C: Store fgetc in int so every unsigned-char value remains distinguishable from EOF.

C✓ Tested
Bash ScriptsInput streams & redirection

Read complete lines into an array

Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.

Bash Scripts✓ Tested
PythonFile operations & archives

Read compressed text directly

Python: Open gzip data in text mode with an explicit encoding.

Python✓ Tested
GoFiles & paths

Read text line by line

Read text line by line using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFiles & paths

Reject an escaping relative path

Reject an escaping relative path using a complete Go program with explicit sample inputs.

Go✓ Tested
Docker / ComposeBuild images

Run an image as a non-root user

Choose an unprivileged numeric identity for the default process.

Dockerfile✓ Tested
Docker / ComposeBuild images

Set a working directory

Choose the default directory for later instructions and the running process.

Dockerfile✓ Tested
Docker / ComposeBuild images

Set an image’s default command

Use JSON array syntax for a predictable command.

Dockerfile✓ Tested
C++Filesystem operations

Set owner-only read and write permissions

C++: Replace ordinary permission bits with the requested owner permissions.

C++✓ Tested
Docker / ComposeDockerfile patterns

Use a build argument while creating an image

Docker / Compose: ARG supplies a build-time value that is not automatically a runtime environment variable.

Docker / Compose✓ Tested
JavaFile operations & binary data

Write and read binary bytes

Java: Use the byte-oriented Files methods when text encoding should not be involved.

Java✓ Tested