ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* help with filename containing spaces
@ 2020-10-17 15:53 Pablo Rodriguez
  0 siblings, 0 replies; only message in thread
From: Pablo Rodriguez @ 2020-10-17 15:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have this sample:

    \setupinteraction[state=start]
    \starttext
    \def\cB{file.pdf}
    \def\cC{file with spaces.pdf}
    %~ \def\PathName{\cldcontext{[[\env{completepath}]]}}
    \def\PathName{%
        \cldcontext{string.gsub([[\env{completepath}]], "\\\\", "/")}}
    no spaces: \doifelsefileexists{\PathName\cB}{yes}{no}
    \attachment[file={\PathName\cB}]\\
    with spaces: \doifelsefileexists{\PathName\cC}{yes}{no}
    \attachment[file={\PathName\cC}]
    \stoptext

It works fine in Linux with spaces in file names. I invoke it with:

    context --purgeall --arguments="pathname={~/}" ~/a

But in Windows, the actual invocation involves a loop in a batch file.
Without the loop, it would read (for drag and drop):

    context --purgeall --arguments="completepath=%~dp1" file-above.tex

I don’t get the attachment only with the file that has spaces in its
name (the file is also reported as not existing). The file without
spaces in the its name is being attached and reported as existing.

Does anyone know what might be preventing ConTeXt in Windows not to
recognize the existing file with spaces in its name?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-17 15:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17 15:53 help with filename containing spaces Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).