StackPractices

file handling

Practical resources about file handling for software engineers.

28 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.

beginner

Bash Scripting for DevOps Automation and System Tasks

How to write reliable Bash scripts for automating deployments, system monitoring, log rotation, and...

intermediate

AWS CLI Automation with Bash

Automate AWS resource provisioning, tagging, and cleanup using Bash scripts wrapped around the AWS...

intermediate

Bash Backup Rotation: Retention and Integrity

Rotate Bash backups into daily, weekly, and monthly archives with retention, encryption, integrity...

intermediate

Log Rotation and Compression

Rotate and compress application logs with Bash to prevent disk exhaustion and simplify log...

beginner

Bash Loop Over Files

How to safely loop over files and directories in Bash, handling spaces, globs, and large file lists...

file-handling bash loops globbing
intermediate

Bash Parallel Execution

How to run shell commands in parallel with xargs, GNU parallel, and Bash background jobs while...

intermediate

Parallel Job Control with Bash

How to control parallel Bash jobs once they're running: collect exit codes, retry failures, enforce...

intermediate

Bash Text Processing

How to build capable text processing pipelines with grep, sed, awk, cut, sort, uniq, and tr for log...

intermediate

Compress and Decompress Files with ZIP, GZIP, and TAR

Create and extract ZIP, GZIP, and TAR archives in Python, Node.js, Java, and Bash, with streaming...

beginner

Compress and Decompress Files with Gzip and Brotli

How to reduce file sizes for APIs, static assets, and log files using Gzip, Brotli, and zlib with...

beginner

Copy and Move Files Safely in Python, JS, Java, and Bash

Learn to copy and move files across platforms with Python, JavaScript, Java, and Bash. Includes...

beginner

Export Data to CSV and Excel Files

How to export structured data to CSV and Excel files efficiently.

intermediate

File Upload Validation: Secure File Handling Guide

How to handle file uploads securely with size, type, and content validation.

intermediate

Generate PDFs

How to generate PDF documents programmatically from HTML, templates, or raw data.

beginner

Generate Temporary Files

How to create temporary files and directories safely with automatic cleanup across Python, Node.js,...

beginner

Image Optimization

How to resize, compress, and optimize images for web performance.

beginner

Import Data from CSV/Excel

How to parse and import data from CSV and Excel files with validation, streaming, and batch inserts.

intermediate

JavaScript Drag and Drop File Upload with HTML5 API

Implement native HTML5 drag and drop file upload in JavaScript

javascript file-upload html5 formdata
intermediate

Node.js File Upload Validation: Type, Size, and Content

Validate file uploads in Node.js with multer for type, size, and content

nodejs express multer file-upload
intermediate

Read Large Files in Node.js with Streams (5GB in 64KB RAM)

Process GB-sized files in Node.js with createReadStream, readline, Transform pipelines, and...

No results found.