From 821628b004118f27ab01ab998acdd37f0408d01e Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 9 Jun 2020 14:59:13 +0100 Subject: [PATCH] [pack/unpack] add missing file. --- src/file_utils.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/file_utils.rs diff --git a/src/file_utils.rs b/src/file_utils.rs new file mode 100644 index 0000000..9768bb8 --- /dev/null +++ b/src/file_utils.rs @@ -0,0 +1,8 @@ +use std::fs; + +pub fn file_exists(path: &str) -> bool { + return match fs::metadata(path) { + Ok(_) => {true} + Err(_) => {false} + } +}