No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Baumann 3369bd8d2b
Releasing fastforward version 1.0.6-1~ffwd13+u1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2026-08-10 13:20:35 +02:00
.github/workflows Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
debian Releasing fastforward version 1.0.6-1~ffwd13+u1. 2026-08-10 13:20:35 +02:00
src Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
tests Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
.cargo_vcs_info.json Merging upstream version 1.0.6. 2026-08-10 13:19:28 +02:00
.gitignore Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
Cargo.lock Merging upstream version 1.0.6. 2026-08-10 13:19:28 +02:00
Cargo.toml Merging upstream version 1.0.6. 2026-08-10 13:19:28 +02:00
Cargo.toml.orig Merging upstream version 1.0.6. 2026-08-10 13:19:28 +02:00
LICENSE-APACHE Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
LICENSE-MIT Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00
README.md Adding upstream version 1.0.5. 2026-07-20 11:33:18 +02:00

is_executable

Is there an executable file at the given path?

CI

A small helper function which determines whether or not the given path points to an executable file. If there is no file at the given path, or the file is not executable, then false is returned. When there is a file and the file is executable, then true is returned.

This crate works on both Unix-based operating systems (macOS, Linux, FreeBSD, etc...) and Windows.

Does not help with time-of-check to time-of use (TOCTOU) races.

The API comes in two flavors:

  1. An extension trait to add an is_executable method on std::path::Path:

    use std::path::Path;
    use is_executable::IsExecutable;
    
    fn main() {
        let path = Path::new("some/path/to/a/file");
    
        // Determine if `path` is executable.
        if path.is_executable() {
            println!("The path is executable!");
        } else {
            println!("The path is _not_ executable!");
        }
    }
    
  2. For convenience, a standalone is_executable function, which takes any AsRef<Path>:

    use std::path::Path;
    
    use is_executable::is_executable;
    
    fn main() {
        let path = Path::new("some/path/to/a/file");
    
        // Determine if `path` is executable.
        if is_executable(&path) {
            println!("The path is executable!");
        } else {
            println!("The path is _not_ executable!");
        }
    }
    

License: Apache-2.0/MIT