is possible from path know if is file or folder lazarus / 34-Windows ---------------------------------------------------------------------- eldonfsr · 2022-02-23 03:57 Is possible to know from path or string to know if is file or folder... I think check if has extension or not but now paths also allow many characters... ---------------------------------------------------------------------- trev · 2022-02-23 04:29 See https://www.freepascal.org/docs-html/rtl/sysutils/fileexists.html ---------------------------------------------------------------------- dsiders · 2022-02-23 04:34 Quote from: trev on February 23, 2022, 05:29:40 amSee https://www.freepascal.org/docs-html/rtl/sysutils/fileexists.html And: https://www.freepascal.org/docs-html/rtl/sysutils/directoryexists.html https://www.freepascal.org/docs-html/rtl/sysutils/findfirst.html For UTF-8 equivalents: https://dsiders.gitlab.io/lazdocsnext/lazutils/lazfileutils/fileexists utf8.html https://dsiders.gitlab.io/lazdocsnext/lazutils/lazfileutils/directorye xistsutf8.html https://dsiders.gitlab.io/lazdocsnext/lazutils/lazfileutils/findfirstu tf8.html ---------------------------------------------------------------------- Remy Lebeau · 2022-02-23 17:05 Quote from: eldonfsr on February 23, 2022, 04:57:45 amIs possible to know from path or string to know if is file or folder... Yes, simply query the path for its attributes, such as with SysUtils.FileGetAttr() or equivalent. If the attributes include the faDirectory flag, the path is for a folder, otherwise it is for a file. Quote from: eldonfsr on February 23, 2022, 04:57:45 amI think check if has extension or not but now paths also allow many characters... That is not reliable enough.  Folder paths can have dots in them.