| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| .github/workflows/ | 03-May-2024 | - | 53 | 52 | ||
| src/ | 03-May-2024 | - | 2,492 | 894 | ||
| tests/ | 03-May-2024 | - | 965 | 777 | ||
| .cargo_vcs_info.json | D | 03-May-2024 | 94 | 6 | 6 | |
| .gitignore | D | 03-May-2024 | 18 | 3 | 2 | |
| Android.bp | D | 03-May-2024 | 1.9 KiB | 61 | 57 | |
| Cargo.toml | D | 03-May-2024 | 1.5 KiB | 44 | 39 | |
| Cargo.toml.orig | D | 03-May-2024 | 990 | 43 | 36 | |
| LICENSE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
| LICENSE-APACHE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
| LICENSE-MIT | D | 03-May-2024 | 1 KiB | 26 | 22 | |
| METADATA | D | 03-May-2024 | 635 | 24 | 22 | |
| MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | |||
| NEWS | D | 03-May-2024 | 4.4 KiB | 207 | 134 | |
| OWNERS | D | 03-May-2024 | 77 | 4 | 3 | |
| README.md | D | 03-May-2024 | 1.2 KiB | 46 | 34 | |
| TEST_MAPPING | D | 03-May-2024 | 661 | 30 | 29 | |
| cargo2android.json | D | 03-May-2024 | 142 | 9 | 9 |
README.md
1tempfile 2======== 3 4[](https://crates.io/crates/tempfile) 5[](https://github.com/Stebalien/tempfile/actions/workflows/ci.yml?query=branch%3Amaster) 6 7A secure, cross-platform, temporary file library for Rust. In addition to creating 8temporary files, this library also allows users to securely open multiple 9independent references to the same temporary file (useful for consumer/producer 10patterns and surprisingly difficult to implement securely). 11 12[Documentation](https://docs.rs/tempfile/) 13 14Usage 15----- 16 17Minimum required Rust version: 1.40.0 18 19Add this to your `Cargo.toml`: 20```toml 21[dependencies] 22tempfile = "3" 23``` 24 25Example 26------- 27 28```rust 29use std::fs::File; 30use std::io::{Write, Read, Seek, SeekFrom}; 31 32fn main() { 33 // Write 34 let mut tmpfile: File = tempfile::tempfile().unwrap(); 35 write!(tmpfile, "Hello World!").unwrap(); 36 37 // Seek to start 38 tmpfile.seek(SeekFrom::Start(0)).unwrap(); 39 40 // Read 41 let mut buf = String::new(); 42 tmpfile.read_to_string(&mut buf).unwrap(); 43 assert_eq!("Hello World!", buf); 44} 45``` 46