From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100800 Path: news.gmane.org!.POSTED!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: Re: Files on a server Date: Wed, 16 May 2018 13:23:35 +0200 Message-ID: References: <69D183B2-1264-4399-A805-591A82569287@ziggo.nl> <866b81fb-8850-f813-fc48-ed101772028c@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Content-Type: multipart/mixed; boundary="===============0227742974596326855==" X-Trace: blaine.gmane.org 1526469737 25263 195.159.176.226 (16 May 2018 11:22:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 May 2018 11:22:17 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Wed May 16 13:22:13 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fIuVZ-0006Tk-1K for gctc-ntg-context-518@m.gmane.org; Wed, 16 May 2018 13:22:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BDA9628B7C; Wed, 16 May 2018 13:23:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lc3ZoMlCIbzG; Wed, 16 May 2018 13:23:49 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 4547128B7E; Wed, 16 May 2018 13:23:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C7B4928B7E for ; Wed, 16 May 2018 13:23:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xJXGgAyPl1Tn for ; Wed, 16 May 2018 13:23:46 +0200 (CEST) Original-Received: from smtpq3.tb.mail.iss.as9143.net (smtpq3.tb.mail.iss.as9143.net [212.54.42.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 5A88528B7C for ; Wed, 16 May 2018 13:23:36 +0200 (CEST) Original-Received: from [212.54.42.132] (helo=smtp8.tb.mail.iss.as9143.net) by smtpq3.tb.mail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1fIuWt-0001tu-Qi for ntg-context@ntg.nl; Wed, 16 May 2018 13:23:35 +0200 Original-Received: from 546a86c8.cm-12-3c.dynamic.ziggo.nl ([84.106.134.200] helo=[192.168.178.10]) by smtp8.tb.mail.iss.as9143.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1fIuWt-0002e8-NA for ntg-context@ntg.nl; Wed, 16 May 2018 13:23:35 +0200 In-Reply-To: <866b81fb-8850-f813-fc48-ed101772028c@gmail.com> X-Mailer: Apple Mail (2.3445.6.18) X-SourceIP: 84.106.134.200 X-Authenticated-Sender: havdmeer@ziggo.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.3 cv=HMbt6Llv c=1 sm=1 tr=0 a=wCstmS+ZHA3zSJXjQC+ubA==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=VUJBJC2UJ8kA:10 a=pGLkceISAAAA:8 a=YGgp-goRAAAA:8 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=xtERp6CFAAAA:8 a=a3nu-2BBAAAA:8 a=mF9MrawiXib1zfmvyDQA:9 a=CjuIK1q_8ugA:10 a=qcOdKiK5pRVJxesbztkA:9 a=JreKqJZr83o-RfrC:21 a=_W_S_7VecoQA:10 a=jGrNUvj8ck4JNooP3QZQ:22 a=LmrbSfiT3hecnSZifb5M:22 a=V0662LiR8DSfwiDagK97:22 a=Sab0UneHBzlWrQDlOuxD:22 a=ekCXXmE-vB8RPiJ3MEZb:22 none X-Ziggo-Spam-Status: No X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100800 Archived-At: --===============0227742974596326855== Content-Type: multipart/alternative; boundary="Apple-Mail=_F8AEE330-2EFB-4E16-A32A-3B0BC777105F" --Apple-Mail=_F8AEE330-2EFB-4E16-A32A-3B0BC777105F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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: >=20 > 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: >>=20 >> % 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}} >>=20 >> It seems that \doiffileelse always results in true except for local >> files where nonexistence is correctly handled. >>=20 >> 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.pd= f >>=20 >> Is it possible that the \doiffile macros are extended for files on = the >> internet or a correponding set \doifurl is developed? >=20 > 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? >=20 >>=20 >> Hans van der Meer >>=20 >>=20 >>=20 >> = __________________________________________________________________________= _________ >> If your question is of interest to others as well, please add an = entry to the Wiki! >>=20 >> 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 >> = __________________________________________________________________________= _________ >>=20 >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_F8AEE330-2EFB-4E16-A32A-3B0BC777105F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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 <henrimenke@gmail.com> 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-1= 869-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 / 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
_______________________________________________________________= ____________________

= --Apple-Mail=_F8AEE330-2EFB-4E16-A32A-3B0BC777105F-- --===============0227742974596326855== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============0227742974596326855==--