Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

windows directories containing spaces

3 views
Skip to first unread message

Edgar G. Goodaire

unread,
Oct 6, 2003, 5:22:11 PM10/6/03
to
How do you \input or \include a file whose path includes directories
like /my documents ? I'm using MiKTeX on a PC running the home edition
of XP and MiKTeX doesn't like those spaces. Thanks for any and all help
.................Edgar

--
Edgar G. Goodaire email: ed...@math.mun.ca
Mathematics and Statistics url:
http://www.math.mun.ca/~edgar
Memorial University of Newfoundland phone: 709-737-8097
St. John's, Newfoundland fax: 709-737-3010
Canada A1C 5S7

http://www.math.mun.ca/~aarms/
http://www.math.mun.ca/~apics/


Robert Heller

unread,
Oct 6, 2003, 6:29:44 PM10/6/03
to
"Edgar G. Goodaire" <ed...@math.mun.ca>,
In a message on Mon, 06 Oct 2003 18:52:11 -0230, wrote :

"GG> How do you \input or \include a file whose path includes directories
"GG> like /my documents ? I'm using MiKTeX on a PC running the home edition
"GG> of XP and MiKTeX doesn't like those spaces. Thanks for any and all help

Argg... The 'My Documents' folder under MS-Windows is seriously bad
news. It effectively represents a sort of security hole (in that any
unfriendly person/program that runs on your MS-Windows box knows exactly
where to find all of your important files, the ones you need tomorrow
and don't have backups of...).

You have three options:

1) Don't use 'My Documents'.

2) Change your default working directory to the 'My Documents' directory
and take the directory spec off the file names in \input and \include
(note: the file *names* can't have spaces in them either, but presumably
this is not an issue).

3) Create a shortcut to 'My Documents' in the folder where you are
running TeX/LaTeX. The shortcut name should not include spaces (Duh!).

"GG> .................Edgar
"GG>
"GG> --
"GG> Edgar G. Goodaire email: ed...@math.mun.ca
"GG> Mathematics and Statistics url:
"GG> http://www.math.mun.ca/~edgar
"GG> Memorial University of Newfoundland phone: 709-737-8097
"GG> St. John's, Newfoundland fax: 709-737-3010
"GG> Canada A1C 5S7
"GG>
"GG> http://www.math.mun.ca/~aarms/
"GG> http://www.math.mun.ca/~apics/
"GG>
"GG>
"GG>

\/
Robert Heller ||InterNet: hel...@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || hel...@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153



Patrick TJ McPhee

unread,
Oct 7, 2003, 11:20:33 AM10/7/03
to
In article <3F81DD03...@math.mun.ca>,
Edgar G. Goodaire <ed...@math.mun.ca> wrote:

% How do you \input or \include a file whose path includes directories
% like /my documents ? I'm using MiKTeX on a PC running the home edition
% of XP and MiKTeX doesn't like those spaces. Thanks for any and all help

It's not so much MikTeX, I should think, as TeX syntax itself. When you
use spaces to delimit file names and you don't provide a quoting
mechanism, you can't have spaces in the file name. Of course, long
before windows was able to handle directories with spaces, other systems
were able to do it and people got around the problem by not creating
that sort of directory. `Doctor, there is a pain in my eye whenever I
have a cup of tea.' `Try taking out the spoon first.'

I suggest that you add /my documents to the MikTeX search path. If it's
a web2c system, you can do this by modifying the TEXINPUTS setting in
texmf.cnf. There's likely an environment variable as well. If it's not
a web2c system, there's still going to be a way to set a search path,
and it's going to support spaces in file names (because people don't
like to take good advice).

In general, it's not a good idea to include full paths to file names
with \include or \input. It makes it much more difficult to work with
them if you have to change your directory structure for some reason
(for instance because you're collaborating with someone or you borrow
a machine). It can also lead to memory problems because file names
get stored in a fairly small piece of TeX memory.
--

Patrick TJ McPhee
East York Canada
pt...@interlog.com

William F. Adams

unread,
Oct 7, 2003, 11:34:01 PM10/7/03
to
Find out what the ``short'' (8-character) filename is and use that instead.

For instance, ``Program Files'' will typically be ``C:\PROGRA~1''

William

--
William Adams
http://members.aol.com/willadams
Sphinx of black quartz, judge my vow.

Donald Arseneau

unread,
Oct 8, 2003, 1:32:42 AM10/8/03
to
will...@aol.com (William F. Adams) writes:

> Find out what the ``short'' (8-character) filename is and use that instead.
>
> For instance, ``Program Files'' will typically be ``C:\PROGRA~1''

Which might require "c:/progra\string~1" to access from TeX.
^ ^^^^^^^


Donald Arseneau as...@triumf.ca

Udo Zallmann

unread,
Oct 8, 2003, 8:11:38 AM10/8/03
to
Robert Heller wrote:

> Argg... The 'My Documents' folder under MS-Windows is seriously bad
> news.

I wouldn't say 'news,' since it has been there for the last 8 years or
so, since the advent of Windows 95. Windows 2000 and XP just add more
spaces to the default path. ;)

> 3) Create a shortcut to 'My Documents' in the folder where you are
> running TeX/LaTeX. The shortcut name should not include spaces (Duh!).

Folders cannot be accessed programmatically through a Windows
shortcut. And Windows filesystems do not support links either. (Well,
NTFS does hardlinks, but it is quite unclear how to create them...)

udo
--
Signatur ist ausverkauft.

Andreas Keil

unread,
Oct 8, 2003, 9:08:21 AM10/8/03
to
"Udo Zallmann" <nong...@hotmail.com> wrote:
> Folders cannot be accessed programmatically through a Windows
> shortcut. And Windows filesystems do not support links either. (Well,
> NTFS does hardlinks, but it is quite unclear how to create them...)

In fact, I didn't know that it's possible to create hardlinks on NTFS.
How do you do that? Could you please explain me how to do this or give
me a ressource on the internet?
Thanks.

--
Andreas
For replying, remove the fruit from my address.


Patrick TJ McPhee

unread,
Oct 8, 2003, 9:45:14 AM10/8/03
to
In article <bm1285$ji3$1...@news-sop.inria.fr>,
Andreas Keil <andrea...@apple.nurfuerspam.de> wrote:
% "Udo Zallmann" <nong...@hotmail.com> wrote:
% > Folders cannot be accessed programmatically through a Windows
% > shortcut. And Windows filesystems do not support links either. (Well,
% > NTFS does hardlinks, but it is quite unclear how to create them...)
%
% In fact, I didn't know that it's possible to create hardlinks on NTFS.
% How do you do that? Could you please explain me how to do this or give
% me a ressource on the internet?
% Thanks.

There's an API starting in, I think, Windows 2000. I don't remember
what it's called off the top of my head. A few Unix toolkits
for NT provide ln commands that work. http://unxutils.sf.net is one.

Andreas Keil

unread,
Oct 8, 2003, 12:54:47 PM10/8/03
to
"Patrick TJ McPhee" <pt...@interlog.com> wrote:
> % In fact, I didn't know that it's possible to create hardlinks on
NTFS.
> % How do you do that? Could you please explain me how to do this or
give
> % me a ressource on the internet?
> % Thanks.
>
> There's an API starting in, I think, Windows 2000. I don't remember
> what it's called off the top of my head. A few Unix toolkits
> for NT provide ln commands that work. http://unxutils.sf.net is one.

Thank you. I'll try it.

Giuseppe Bilotta

unread,
Oct 8, 2003, 1:13:28 PM10/8/03
to
Andreas Keil wrote:
> "Udo Zallmann" <nong...@hotmail.com> wrote:
> > Folders cannot be accessed programmatically through a Windows
> > shortcut. And Windows filesystems do not support links either. (Well,
> > NTFS does hardlinks, but it is quite unclear how to create them...)
>
> In fact, I didn't know that it's possible to create hardlinks on NTFS.
> How do you do that? Could you please explain me how to do this or give
> me a ressource on the internet?
> Thanks.

C:\TEMP>dir > testfile

C:\TEMP>dir testfile
Volume in drive C has no label.
Volume Serial Number is DC52-FE0F

Directory of C:\TEMP

08/10/2003 17.16 2.613 testfile
1 File(s) 2.613 bytes
0 Dir(s) 4.425.297.920 bytes free

C:\TEMP>fsutil hardlink create testfile2 testfile
Hardlink created for C:\TEMP\testfile2 <<===>> C:\TEMP\testfile

C:\TEMP>dir testfile*
Volume in drive C has no label.
Volume Serial Number is DC52-FE0F

Directory of C:\TEMP

08/10/2003 17.16 2.613 testfile
08/10/2003 17.16 2.613 testfile2
2 File(s) 5.226 bytes
0 Dir(s) 4.425.297.920 bytes free

C:\TEMP>

Search the Windows help file on "fsutil" for the other interesting
stuff (sparse files, etc).

--
Giuseppe "Oblomov" Bilotta

Can't you see
It all makes perfect sense
Expressed in dollar and cents
Pounds shillings and pence
(Roger Waters)

Andreas Keil

unread,
Oct 8, 2003, 1:32:32 PM10/8/03
to
"Giuseppe Bilotta" <bilo...@hotpop.com> wrote:
> [...]

> Search the Windows help file on "fsutil" for the other interesting
> stuff (sparse files, etc).

It seems that "fsutil" is only available under WinXP. I didn't find it
on my Win2000 machine. The documentation on the MS website
(http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prod
technol/winxppro/proddocs/fsutil.asp) seems to say the same.

Do you know if it works on Win2000 or if there's sth. similar for
Win2000?

Could you please send me your fsutil.exe by e-mail to
andrea...@apple.nurfuerspam.de (after removing the fruit), so that I
can try myself?

Thanks a lot.

Giuseppe Bilotta

unread,
Oct 8, 2003, 2:43:24 PM10/8/03
to

I'm sending you the file. I hope it will work on Win2K, even though I
have my doubts. Let me know if there's some "missing export".

Andreas Keil

unread,
Oct 8, 2003, 3:03:42 PM10/8/03
to
"Giuseppe Bilotta" <bilo...@hotpop.com> wrote:

> Andreas Keil wrote:
> > Could you please send me your fsutil.exe by e-mail to
> > andrea...@apple.nurfuerspam.de (after removing the fruit), so
that I
> > can try myself?
> >
> > Thanks a lot.
>
> I'm sending you the file. I hope it will work on Win2K, even though I
> have my doubts. Let me know if there's some "missing export".

I received it. Thank you very much.
I read somewhere that it works fine on Win2000 systems, too. But I will
not try it out now on the institute's machine. I'll have to wait for an
answer until I have access to my own computer again (in 1 1/2 months).
Thank you anyways, I was always waiting for such hardlinks under
Microsoft file systems.

Giuseppe Bilotta

unread,
Oct 8, 2003, 3:33:21 PM10/8/03
to

You can actually do some cheating to obtain hardlinks with FAT
filesystems too, provided you're willing to run a few risks, do some
low-level editing and not run any internal filesystem check.

Rudolf Polzer

unread,
Oct 8, 2003, 6:38:17 PM10/8/03
to
Scripsit ille »Giuseppe Bilotta« <bilo...@hotpop.com>:

> You can actually do some cheating to obtain hardlinks with FAT
> filesystems too, provided you're willing to run a few risks, do some
> low-level editing and not run any internal filesystem check.

And provided you'll never delete the file or change its length.


--
Wenn dir mal klar ist,
dass bei 3 Bit zwei Zahlen mehr sind als bei 2 Bit,
dann hast du mal was kapiert.
[Hans Joss in de.sci.mathematik]

Giuseppe Bilotta

unread,
Oct 8, 2003, 6:43:38 PM10/8/03
to
Rudolf Polzer wrote:
> Scripsit ille »Giuseppe Bilotta« <bilo...@hotpop.com>:
> > You can actually do some cheating to obtain hardlinks with FAT
> > filesystems too, provided you're willing to run a few risks, do some
> > low-level editing and not run any internal filesystem check.
>
> And provided you'll never delete the file or change its length.

Well, you can do it but need to low-level edit the filesystem each
time :)

Andreas Keil

unread,
Oct 9, 2003, 5:19:23 AM10/9/03
to
"Giuseppe Bilotta" <bilo...@hotpop.com> a écrit dans le message de
news:MPG.19eeb1802...@news.cis.dfn.de...

> Rudolf Polzer wrote:
> > Scripsit ille »Giuseppe Bilotta« <bilo...@hotpop.com>:
> > > You can actually do some cheating to obtain hardlinks with FAT
> > > filesystems too, provided you're willing to run a few risks, do
some
> > > low-level editing and not run any internal filesystem check.
> >
> > And provided you'll never delete the file or change its length.
>
> Well, you can do it but need to low-level edit the filesystem each
> time :)

OK, OK, I will stick to the MS provided tool anyways. This should allow
me to change file size after having created a hardlink, right?

--
Andreas
For replying, please remove the fruit from my address.


Giuseppe Bilotta

unread,
Oct 9, 2003, 6:58:41 AM10/9/03
to

With NTFS, hardlinks are standard hardlinks, no worry :) The tricks
are to make pseudo-hardlinks on FAT systems.

Anthony Williams

unread,
Oct 9, 2003, 12:30:16 PM10/9/03
to
Udo Zallmann <nong...@hotmail.com> writes:

> Robert Heller wrote:
>> 3) Create a shortcut to 'My Documents' in the folder where you are
>> running TeX/LaTeX. The shortcut name should not include spaces (Duh!).
>
> Folders cannot be accessed programmatically through a Windows shortcut. And
> Windows filesystems do not support links either. (Well, NTFS does hardlinks,
> but it is quite unclear how to create them...)

NTFS supports Junctions, which are like soft links for directories, except
they must be to other local mount points, so can't be network drives. Unless
you know they're there, they behave just like directories (including
programmatically)

Sysinternals provide a free utility (junction.exe) to create and delete NTFS
junctions.

Anthony
--
Anthony Williams
Senior Software Engineer, Beran Instruments Ltd.
Remove NOSPAM when replying, for timely response.

0 new messages