Results for “open file”
Small, practical examples. Search by task or narrow things down below.
Handle a failed file open through stream state
C++: An unopened input stream is not an empty successful file read.
C++✓ Tested
Set a service’s open-file limit
Docker / Compose: The ulimits mapping defines soft and hard resource limits.
Docker / Compose✓ Tested
Set the open-file limit for a process
Docker / Compose: The nofile ulimit sets soft and hard file descriptor limits.
Docker / Compose✓ Tested
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
Append text to a file
Open a C++ stream in append mode and verify the write.
C++✓ Tested
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
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
List regular files
List immediate regular files in sorted order and close the Java directory stream.
Java✓ Tested
Offer a downloadable text file
HTML: The download attribute supplies a filename for this same-document data URL.
HTML✓ Tested
Read a UTF-8 file
Read a small UTF-8 file into a Java string.
Java✓ Tested
Read from a dedicated file descriptor
Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.
Bash Scripts✓ Tested
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