[−][src]Function fs_utils::read::head_to_string
pub fn head_to_string<P: AsRef<Path>>(path: P, limit: usize) -> Result<String>
Reads the first N
bytes from a file and return them as a string.
It assumes that the file is encoded with UTF-8, so any invalid UTF-8 sequences will be
replaced with U+FFFD REPLACEMENT CHARACTER
, which looks like this: �, learn more
here).
It is equivalent to head -c limit
*nix utility.