FIND YOUR NEXT FEW LINES

Results for “files”

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

366 snippets foundClear filters
C++Files & paths

Read a file line by line

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

C++✓ Tested
C++Files & paths

Read a filename extension

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

C++✓ Tested
GitTags & repository configuration

Read a repository-specific configuration value

Git: The local scope makes configuration lookup predictable for this practice repository.

Git✓ 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
C#Files & paths

Read a text file

Load a small text file into a C# string.

C#✓ Tested
JavaScriptFiles & async

Read a URL query parameter

Parse a URL with the standard JavaScript URL API.

JavaScript✓ Tested
JavaFiles & paths

Read a UTF-8 file

Read a small UTF-8 file into a Java string.

Java✓ Tested
JavaScriptFiles & async

Read a UTF-8 file

Read a small file as text using Node.js.

JavaScript✓ Tested
PowerShellFiles & paths

Read a whole text file

Load text as one string instead of one item per line.

Get-Content✓ Tested
GitTags & repository configuration

Read an annotated tag’s message

Git: for-each-ref can inspect annotation contents without including a commit diff.

Git✓ Tested
Docker / ComposeImage management

Read an image’s default command

Docker / Compose: Config.Cmd contains the command arguments stored in the image.

Docker / Compose✓ Tested