WolframLang: is File or Dir

By Xah Lee. Date: .

Check is File or Dir

DirectoryQ["c:/Users/xah/abc.txt"]
(* False *)

DirectoryQ["c:/Users/xah/"]
(* True *)
(* is file *)
FileType[ "c:/Users/xah/web/xahlee_info/M/WolframScript.html" ] === File

(* is dir *)
FileType[ "c:/Users/xah/" ] === Directory

(* doesn't exist *)
FileType[ "c:/Users/xah/tt" ] === None

WolframLang: Shell Tasks