07-17-2018, 03:14 PM
Kevin you're right, "dir" is now obsolete. So now I update my "IsFileExist" function to this:
Function IsFileExist
Macro IsFileExist Test
Function IsFileExist
function# str'file
Dir d; str s
foreach(d _s.expandpath(file) FE_Dir 0|4|32)
,s = d.FileName
,if s.len
,,ret 1
ret 0
Macro IsFileExist Test
out
;Note: folders ("c:\x1" and "d:\z1" are just empty folders for testing only.
str files=
;c:\*
;c:\temp\*.csv
;c:\temp\*.htm
;c:\temp\*.txt
;c:\temp\*.docx
;c:\x1\*
;d:\*
;d:\download\*.apk
;d:\download\*.epub
;d:\download\*.mobi
;d:\download\*.pdf
;d:\download\*.txt
;d:\download\*.rar
;d:\z1\*
str file
foreach file files
,if IsFileExist(file)
,,out F"{file} exist."
,else
,,out F"{file} is NONE!"