Getting ready

Follow the following steps to set up the project and install the dependencies:

  1. Create a new binary project named sample_decom, and enter the directory:
      cargo new --bin sample_decom && cd sample_decom
  1. Install the error_chain, tar, and flate2 crates dependencies:
      cargo add error-chain tar flate2
  1. cargo add crate_name automatically adds the latest version of the dependency to the Cargo.toml file.
  2. Install the dependency by running the following command:
      cargo run
  1. This step will print hello world as output, as we have not yet made any modifications to the source code.
  2. Create a sample file, TAR it, and delete it for using it in the recipe:
        touch sample_file1.txt && tar -cvzf archieve.tar.gz
sample_file1.txt && rm sample_file1.txt
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.189.228