Sign in

    which

    A Moonbit equivalent of Unix command "which". Locate installed executable in cross platforms.

    which
    moonbit
    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    last year
    Downloads
    43

    #which-mbt

    A MoonBit equivalent of Unix command "which".

    File

    type File

    WhichError

    pub enum WhichError {
    PathNotFound(String)
    UnknownPlatform(String)
    UnSupportedPlatform(String)
    FileNotFound(String)
    }

    impl Show for WhichError

    which

    fn which(filename : String) -> String!WhichError
    Find the first matching file in environment variables based on the given filename

    Parameters

    • filename : The string representing the path to be checked.

    Returns

    • String : the absolute path of the file

    which_all

    fn which_all(filename : String) -> Array[String]!WhichError
    Find all matching files in environment variables based on the given filename

    which_in

    fn which_in(filename : String, filepath : Array[String]) -> String!WhichError
    Find the first matching file based on the given filename and filepath

    Parameters

    • filename : The string representing the path to be checked.

    • filepath : A string array containing all paths to be searched.

    Returns

    • String : the absolute path of the file

    which_in_all

    fn which_in_all(filename : String, filepath : Array[String]) -> Array[String]!WhichError
    Find all matching file based on the given filename and filepath

    Parameters

    • filename : The string representing the path to be checked.

    • filepath : A string array containing all paths to be searched.

    Returns

    • Array[String] : A string array containing all the file in given filepath

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io