FIND YOUR NEXT FEW LINES

Results for “open file”

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

1107 snippets foundClear filters
C++Filesystem operations

Handle a failed file open through stream state

C++: An unopened input stream is not an empty successful file read.

C++✓ Tested
Docker / ComposeCompose service options

Set a service’s open-file limit

Docker / Compose: The ulimits mapping defines soft and hard resource limits.

Docker / Compose✓ Tested
Docker / ComposeLimits & process security

Set the open-file limit for a process

Docker / Compose: The nofile ulimit sets soft and hard file descriptor limits.

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

Append text to a file

Open a C++ stream in append mode and verify the write.

C++✓ Tested
HTMLForm behavior

Choose a local file through a labeled control

HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.

HTML✓ Tested
CFile positioning & lifecycle

Handle a missing file without treating it as an empty file

C: Inspect errno after a failed fopen to distinguish the documented missing-path condition.

C✓ Tested
JavaFiles & paths

List regular files

List immediate regular files in sorted order and close the Java directory stream.

Java✓ Tested
HTMLMetadata & document links

Offer a downloadable text file

HTML: The download attribute supplies a filename for this same-document data URL.

HTML✓ Tested
JavaFiles & paths

Read a UTF-8 file

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

Java✓ Tested
Bash ScriptsInput streams & redirection

Read from a dedicated file descriptor

Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.

Bash Scripts✓ Tested
CFile positioning & lifecycle

Replace bytes at a known position in a binary file

C: Open in update mode and seek before writing a fixed-size replacement.

C✓ Tested