exec_file_cmd

Function exec_file_cmd 

Source
pub fn exec_file_cmd(path: &str) -> Result<FileCmdOutput>
Expand description

Execute the system file -I command for path and classify the MIME output into a FileCmdOutput.

Used to distinguish:

  • directories
  • text files
  • binary files
  • missing paths
  • unknown types

ยงErrors

  • launching or waiting on the file command fails
  • the command exits with non-success
  • standard output cannot be decoded as valid UTF-8