# [NTG-pdftex] [ pdftex-Bugs-776 ] Filenames with multiple spaces are not recognized

Wed Apr 18 18:13:22 CEST 2007

```Bugs item #776, was opened at 2007-04-17 22:48
You can respond by visiting:
http://sarovar.org/tracker/?func=detail&atid=493&aid=776&group_id=106

Category: Primitives
>Group: v1.40.0
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Reinhard Kotucha (reinhard)
Assigned to: Nobody (None)
Summary: Filenames with multiple spaces are not recognized

Initial Comment:
\$ echo 'hello world\bye' > hello\ \ world.tex
\$ cat hello\ \ world.tex
hello world\bye
\$ pdftex hello\ \ world.tex
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
entering extended mode
! I can't find file `"hello world.tex"'.
<*> "hello  world.tex"

Please type another input file name:

It seems that pdftex gets the correct name (with two
spaces) but it is searching for something different.

Regards,
Reinhard

----------------------------------------------------------------------

>Comment By: Martin Schröder (oneiros)
Date: 2007-04-18 18:13

Message:
Logged In: YES
user_id=421

I agree: This is simply an undocumented misfeature. Anybody
who uses space in filenames in TeX does so at this own risk,
and this should be documented. I don't think the time for
fixing this is justified.

----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2007-04-17 23:36

Message:
Logged In: NO

The command line is scanned by TeX.  The catcodes for the
filename are determined by the format.

If you want TeX to be able to deal with multiple spaces, you
can do so by doing
\everyjob\expandafter{\the\everyjob \catcode`\ =10\relax}
\catcode`\ =12 \dump%
as the last thing when generating your format file.

----------------------------------------------------------------------

Comment By: Taco Hoekwater (taco)
Date: 2007-04-17 23:20

Message:
Logged In: YES
user_id=1608

It will handle this properly:

\$ pdftex hello\ \space\ world.tex

The problem (of course) is that the tokenizer will fold two
(or more) tokens of \catcode 10 into a single one, so you
have to prevent tex from seeing two of these in-a-row.

It may actually be possible to fix the case where the file
is given as a single argument on the commandline, but fixing
the general case is unreasonably hard (e.g. \input commands
used inside macros), I do not think would be worth the
effort and therefore vote for documenting the current
behaviour as a known limitation.

----------------------------------------------------------------------

You can respond by visiting:
http://sarovar.org/tracker/?func=detail&atid=493&aid=776&group_id=106
```