Page 1 of 1

"if file exists" option...

Posted: 2007-11-12 00:01:20
by ABNormal
hello antoine,
is there a way to let scripts control if a file exists?
i'ld like to obtain something like:

link:='http://www.****.html';
if link exists then getpage(link);
or,better
if file_exists(link)=result then getpage(link);

does exists a function like this (or is it possible to create it), please?

thank you

Posted: 2007-11-12 13:19:08
by antp
There is nothing in the program currently, but there are two cases:
- does the domain exist -> to test that it takes some time, as usually it is after a timeout that it is considered as non-existing
- does the page exist -> if the site sends a "404/Not Found" error, I could detect it.
But it would be for the next version anyway.
Currently what happens when you try to get a page that do not exist?

Posted: 2007-11-16 08:55:59
by ABNormal
the purpose of my question is to obtain that information not as an error (that stop scripts) but as a variable (in case of "404error" do this and this...).
it should be useful sometimes (a lot of times, for me).

thx
ABN

Posted: 2007-11-16 10:01:30
by antp
Yes, I have to improve the handling of the errors anyway.