kindOf (Function)
Signature: kindOf(path: string) -> Result<string, Error>
Description: Classifies one path as "dir", "file" or "other" as stat reports it. A path that cannot be stated is an Error naming the reason.
Parameters
- path (
string): Path to classify
Returns: Result<string, Error>
Example
match kindOf("src") {
Success { value } => print(value)
Error { message } => print(message)
}
match kindOf "src"
Success value => print value
Error message => print message