I would be satisfied when a returned 404 error code will be handled within a reasonable (configurable) time delay. As for redirection, there I would not mind if it is not included. Restrictions like that are not a problem for me, because this is for building a pdf that accesses many internet located files. The check on existence is therefore especially meant for spotting missing or misnamed files. Hans van der Meer
On 16 May 2018, at 12:41, Henri Menke
wrote: On 05/16/2018 09:31 PM, Hans van der Meer wrote:
I tried to determine the existence of a file on the internet. See the following macro call:
% Test if file exists. \edef\theurl{\linkprotocol://\urlbase\xmlatt{#1}{link}\thesuffix} \doiffileelse {\theurl} {\verbose{HVDM-PEV-TEST}{file exists: \theurl}} {\verbose{HVDM-PEV-TEST}{file does not exist: \theurl}}
It seems that \doiffileelse always results in true except for local files where nonexistence is correctly handled.
For example the following url definitely does not exist but nevertheless \doiffileelse reports its existence: HVDM-PEV-TEST > file exists: http://hansvandermeer.myqnapcloud.com/archive/denhaag/hga-dtb-1869-6040.pdf
Is it possible that the \doiffile macros are extended for files on the internet or a correponding set \doifurl is developed?
I'm not speaking for the devs here, but I don't think that this is going to be included. It would require that all webpages send proper 404 codes and timeout after reasonable delay. Also how would you handle redirects? Should the ConTeXt run be stalled because checking for a files existence on the web is caught in a redirect loop?
Hans van der Meer
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto:ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl http://www.pragma-ade.nl/ / http://context.aanhet.net http://context.aanhet.net/ archive : https://bitbucket.org/phg/context-mirror/commits/ https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net http://contextgarden.net/ ___________________________________________________________________________________