{"id":22378855,"url":"https://github.com/owenthewizard/mktemp-rs","last_synced_at":"2025-07-31T01:31:28.211Z","repository":{"id":57639352,"uuid":"162419630","full_name":"owenthewizard/mktemp-rs","owner":"owenthewizard","description":"A thin wrapper around libc's mkstemps and mkdtemp","archived":false,"fork":false,"pushed_at":"2019-04-15T03:50:55.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T01:18:41.296Z","etag":null,"topics":["mkstemp","rust","rust-library","temp","tempdir","tempfile"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owenthewizard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-19T10:12:00.000Z","updated_at":"2021-12-29T11:44:30.000Z","dependencies_parsed_at":"2022-08-27T20:03:03.624Z","dependency_job_id":null,"html_url":"https://github.com/owenthewizard/mktemp-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenthewizard%2Fmktemp-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenthewizard%2Fmktemp-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenthewizard%2Fmktemp-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owenthewizard%2Fmktemp-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owenthewizard","download_url":"https://codeload.github.com/owenthewizard/mktemp-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228204672,"owners_count":17884711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mkstemp","rust","rust-library","temp","tempdir","tempfile"],"created_at":"2024-12-04T23:08:04.089Z","updated_at":"2024-12-04T23:08:04.802Z","avatar_url":"https://github.com/owenthewizard.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mktemp-rs\n\nA thin wrapper around `libc`'s `mkstemps` and `mkdtemp`.\n\n## Quick Start ([Documentation](https://docs.rs/mktemp-rs))\n\n`Cargo.toml`:\n```diff\nname = \"my-awesome-project\"\nversion = \"0.1.0\"\nauthors = [\"me\"]\n\n[dependencies]\n+mktemp-rs = \"0.1.0\"\n```\n\n`main.rs`:\n```rust\nuse std::fs;\nuse std::io::{Seek, SeekFrom, Read, Write};\nuse mktemp::TempFile;\n\nfn readme() {\n    let path;\n    {\n        let mut tf = TempFile::new(\"my-temp-file-\", \".txt\").expect(\"Failed to create tempfile\");\n        let mut buf = [0u8; 12];\n        tf.write(b\"Hello world!\").expect(\"Failed to write to tempfile\");\n        tf.seek(SeekFrom::Start(0)).expect(\"Failed to seek in tempfile\");\n        tf.read(\u0026mut buf).expect(\"Failed to read tempfile\");\n        assert_eq!(\u0026buf, b\"Hello world!\");\n        path = tf.path().to_string();\n    }\n    assert!(fs::metadata(\u0026path).is_err());\n}\n```\n\n`mktemp-rs` currently only support Unix platforms. As always, pull requests are welcome.\n\n### Tests\n\n[`readme`](tests/readme.rs) tests the example in this readme.\n\n[`temp_dir`](tests/temp_dir.rs) tests various TempDir functions.\n\n[`temp_file`](tests/temp_file.rs) tests various TempFile functions.\n\n### Coding Style\n\nObey `rustfmt` and Rust 2018 conventions.\n\n## Contributing\n\nPull requests are always welcome. See [TODO](TODO.md).\n\n## Versioning\n\nThis project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\nChanges are documented in the [Changelog](CHANGELOG.md).\n\nSee the [tags on this repository](https://github.com/owenthewizard/mktemp-rs/tags) for available releases.\n\n## Authors\n\nSee [the list of contributors](https://github.com/owenthewizard/mktemp-rs/contributors).\n\n## License\n\n`mktemp-rs` is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE.md) and [LICENSE-MIT](LICENSE-MIT.md) for details.\n\n## Acknowledgments\n\n* [mkstemp](https://gitlab.com/worr/mkstemp) by William Orr for inspiration and code base.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowenthewizard%2Fmktemp-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowenthewizard%2Fmktemp-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowenthewizard%2Fmktemp-rs/lists"}