Page 1 of 1

how to check if a file exist?

Posted: Tue Feb 17, 2004 1:47 pm
by bernardfrancois
hello,

does anyone know how I can check if a file exists?

greetz,

Bernard

Posted: Tue Feb 17, 2004 1:50 pm
by LarsG
oops... sorry.. misread the docs.. :lol:
I suggested Openfile(), but it will create a file if it doesn't exist..
but you can use ReadFile() I guess?!?

[edit for the n'th time :roll: ] .. or you can go for Berikco's code below.. [/edit]

Posted: Tue Feb 17, 2004 1:53 pm
by Berikco

Code: Select all

If FileSize(FileName$) > -1 ; file exist

Endif

Posted: Tue Feb 17, 2004 1:58 pm
by bernardfrancois
bedankt / merci :)

Posted: Tue Feb 17, 2004 3:05 pm
by Berikco
LarsG wrote:oops... sorry.. misread the docs.. :lol:
I suggested Openfile(), but it will create a file if it doesn't exist..
but you can use ReadFile() I guess?!?

[edit for the n'th time :roll: ] .. or you can go for Berikco's code below.. [/edit]
@LarsG: ROFLMAO Image

Posted: Wed Feb 18, 2004 5:20 pm
by blueznl
i guess everybody expects an if exist() function... :-)

so did i :oops: