Skip to content

Commit

Permalink
ELF binary output deletion function on io.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Feb 21, 2024
1 parent 0b5ddce commit 68d3a19
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/rishka-cc/src/io.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
/*
* This file is part of the Rishka distribution (https://github.com/rishka-esp32/rishka-sdk).
* Copyright (c) 2024 Nathanne Isip.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use crate::args::Options;
use std::fs;

pub fn delete_gpp_output(options: &Options) -> bool {
fs::remove_file(format!("{}.out", options.output)).is_ok()
}

pub fn directory_exists(directory_path: &str) -> bool {
match fs::metadata(directory_path) {
Ok(meta)=> meta.is_dir(),
Expand Down

0 comments on commit 68d3a19

Please sign in to comment.