- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 94字
- 2021-07-02 23:07:22
Reading from a file
Here, we are going to use std::io, std::io::prelude::* and std::fs::File. std::io is the standard input/output library, the * after prelude means to use anything in the prelude library, and std::fs is the filesystem library.
Filesystem calls are very platform-specific; Windows users use the likes of C://Users/Paul/Documents/My Documents for the user's home directory, whereas Linux and macOS machines would use ~/ for the user's home directory. If a path is not given for a file, the program will assume the file is in the same directory in which the binary resides.
推薦閱讀
- SQL Server 2016從入門到精通(視頻教學超值版)
- 垃圾回收的算法與實現
- Clojure for Domain:specific Languages
- 編寫整潔的Python代碼(第2版)
- Learning Bayesian Models with R
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- Web程序設計(第二版)
- H5頁面設計:Mugeda版(微課版)
- 軟件測試技術指南
- Java EE 8 Application Development
- Android驅動開發權威指南
- Java語言程序設計教程
- ArcGIS for Desktop Cookbook
- Magento 2 Beginners Guide
- Web開發的平民英雄:PHP+MySQL