StackPractices

file handling

Practical resources about file handling for software engineers.

26 results

Working with Files and Streams

File operations are deceptively simple until you face large datasets, concurrent writes, or cross-platform path differences. Production code needs to handle streaming, compression, encoding, and cleanup gracefully.

This section provides recipes for reading large files efficiently, watching directories for changes, compressing archives, rotating logs, and parsing configuration files. Solutions cover Python, Java, Node.js, and Bash for maximum flexibility.

intermediate

Read Large Files

How to read large files efficiently without running out of memory.

beginner

Read and Write Files in Python, Node.js & Bash

How to read and write files safely in Python, Node.js, Bash and Java, with atomic writes and...

intermediate

Rotate Log Files

How to implement log rotation by size, date, and count to prevent disk exhaustion across Python,...

intermediate

Process Large Files with Streams

How to read, transform, and write large files efficiently using streams without loading entire...

intermediate

Watch File Changes

How to monitor file system changes in real time. Covers kernel-level watchers in Python,...

intermediate

Write Large Files

How to write large files efficiently using buffered and streaming output.

No results found.