---
title: Files - dealing with files in Rust
timestamp: 2024-04-26T17:50:01
author: szabgab
published: true
description: All the articles dealing with files. Reading, writing, etc.
tags:
    - File
---

## Tutorial, simple use-cases with files

* [Write to a file](/write-to-a-file)
* Read from a file
* [Read content of a text file - slurp mode](/slurp)
* Read line-by-line
* [Append to a file](/append-to-a-file)
* Get the size of a file
* Update a file
* Create a temporary directory
* Read binary file



* [Guessing MIME-Type, setting Content-Type based on file extension](/guessing-mime-types)
* [Getting file extension in Rust using PathBuf](/getting-file-extension)
* [Set the file extension in Rust](/set-file-extension)
* [Testing with tempfiles and environment variables](/testing-with-environment-variables)
* [Command line counter with plain text file storage in Rust](/cli-counter-with-plain-text-file)

## Special cases with files


* [Disk usage - size of files](/disk-usage)
* [Dealing with YAML files](/yaml).
* [Dealing with JSON files](/json).
* [Dealing with TOML files](/toml).

