官术网_书友最值得收藏!

  • 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.

主站蜘蛛池模板: 东方市| 罗甸县| 德安县| 郸城县| 顺平县| 陆川县| 仙居县| 和龙市| 阳城县| 维西| 饶河县| 宜君县| 工布江达县| 漳平市| 建湖县| 旬邑县| 渑池县| 永春县| 休宁县| 河西区| 万源市| 利津县| 阳西县| 莱阳市| 资中县| 高雄县| 江安县| 太康县| 永丰县| 马龙县| 白河县| 昆山市| 吉木乃县| 修水县| 梁平县| 漳州市| 乌拉特后旗| 嵊州市| 鄂尔多斯市| 新昌县| 南溪县|