Merge pull request #28434 from wxy/20230102.0-️-How-to-read-and-write-files-in-Rust

RP:published/20230102.0 ️ How to read and write files in Rust.md
This commit is contained in:
Xingyu.Wang 2023-01-14 16:48:49 +08:00 committed by GitHub
commit e7015af376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,13 +3,17 @@
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15442-1.html"
如何在 Rust 中读取和写入文件
======
> 跟随这个演示,学习如何在 Rust 中使用文件系统模块。
![][0]
知道如何读写文件对各种用途都很有用。在 Rust 中,这项任务是通过标准库中的文件系统模块([std::fs][1])完成的。在这篇文章中,我将向你介绍如何使用这个模块。
为了演示这项任务,我准备了一些示例代码,也可以在 [GitHub][2] 上找到。
@ -92,7 +96,7 @@ via: https://opensource.com/article/23/1/read-write-files-rust
作者:[Stephan Avenwedde][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -109,3 +113,4 @@ via: https://opensource.com/article/23/1/read-write-files-rust
[9]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#
[10]: https://doc.rust-lang.org/std/fs/fn.read.html
[11]: https://doc.rust-lang.org/std/io/trait.Read.html
[0]: https://opensource.com/sites/default/files/lead-images/rust_programming_crab_sea.png