Open
Description
Description
Add a new category (24_file_io/
) focused on file operations, a crucial skill for Rust developers currently missing from Rustlings.
Proposed Exercises
-
Basic File Reading (file_io1.rs)
- Teaches using
fs::read_to_string
and handling file not found errors - Includes input file with text content to read
- Tests verifying correct content parsing
- Teaches using
-
Buffered Reading & Writing (file_io2.rs)
- Demonstrates efficient reading with
BufReader
and writing withBufWriter
- Processes a large input file line by line
- Writes transformed content to an output file
- Tests verifying correct transformation
- Demonstrates efficient reading with
-
Path Manipulation & Metadata (file_io3.rs)
- Works with
Path
andPathBuf
to handle file paths safely - Extracts and manipulates file metadata (creation time, size, permissions)
- Tests verifying correct metadata extraction
- Works with
Implementation Structure
- Each exercise includes a Rust file and associated input/output files
- Files are embedded and available during testing
- All exercises follow Rustlings patterns with TODO comments and progressive difficulty
Questions
- Is handling extra files (inputs/outputs) compatible with current Rustlings structure?
- Any specific file I/O patterns you'd prefer to prioritize?
I'm happy to draft sample implementations if this proposal is of interest.
cc @mo8it
Metadata
Metadata
Assignees
Labels
No labels