use std::fs;
      
      let data = fs::read("/home/filename").expect("Impossible to read file");
      println!("{}", data.len());
      
      Rust language logo

      Read a file to Vec

      0

      0

      avatar
      Giovanny Gongora
      Codiga's Rust Recipes

      Read a local fila, store to a Vec<u8> and print the content

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.