"if file exists" option...

If you need help on how to use the program
Post Reply
ABNormal
Posts: 135
Joined: 2005-01-08 08:33:38

"if file exists" option...

Post 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
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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?
ABNormal
Posts: 135
Joined: 2005-01-08 08:33:38

Post 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
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Yes, I have to improve the handling of the errors anyway.
Post Reply