Page MenuHome GnuPG

W32 filenames with spaces
Closed, ResolvedPublic


I have experienced this issue with previous versions of gpg. This issue
occurs on a machine running XP SP2. I have to covert extended filenames to
8.3 format to be able to use them with gpg.



Event Timeline

x set Version to 1.4.6.
x added a subscriber: x.

Please explain in more detail. What software are you talking about, what
version, what OS? How can we replicate the problem?

? I am speaking of gpg(GnuPG) for W32 version 1.4.6, Windows XP SP2. I
apologize, I just realized that this is not happening with all long filename,
and that it occurs with short names as well. The issue appears to be just
with names with spaces. I changed the title of this issue to reflect that.
Perhaps it isn't possible resolve with the way commands are undertood, but
here is an example of what I am referring to. Say I wanted to encrypt a file
on my Desktop which requires accessing files in spaced directories or, as an
easier example, say I have a file that I want to encrypt named
"file spaced.txt" in a directory "C:\directory spaced". I would have to
enter "gpg -sear Alice C:\direct~1\filesp~1.txt"

x renamed this task from W32 extended filenames to W32 filenames with spaces.Dec 11 2006, 5:46 PM

Sorry, I looked only at the empty category and came up with my boilerplate
question. I know that spaces files work becuase we had such an issue wuite some
time ago. However, I can't exclude a regression. Will test this now.

Is that gpg version an official build, the one from gpg4win or one build by

Okay, I powered up a W2000 box and did some tests. No problems at all using
file names with one or more spaces.

The official version I assume. I always download the Windows version from

I cannot work with files with spaces in Fedora either. I am running kernel
2.6.18-1.2849.fc6 and GnuPG version 1.4.6-2.i386 .

Is this just an issue of escaping the spaces? Given that the problem seems to
happen across two platforms (Win2k and Fedora Linux) that would be a reasonable

If the last question was posed to me I do no know how to respond, especially
since Werner said that he did not experience the issue on his W2000 box. I am
fairly new to linux and found a suggestion of using ' or " around filenames
with metacharacters. When I put " apostrophe's around the directory/file
names I got it to work in Fedora, *and on Windows XP as well.* I had never
heard of using quotes like that in DOS command line before. e.g. gpg -sear
Alice "c:\directory spaced\file spaced.txt" Is this something that you
assumed I would be doing before Werner, and when you mentioned that the issue
had been fixed awhile back? Is it correct that it should be working this way
on both platforms? I would like to suggest adding this to the *w32* manual if
this is simply a matter of my not entering the apostrophe's when I should have

The way you quote is very different between Unix and Windows. The main point
here is that under unix the shell does the parsing of the arguments whereas
under Windows each program needs to take care about this. This is the reason
that with some windows programs you might get away without proper quoting.

However it proper quoting is always required even under Window. In fact if you
enable auto-filename completion under Windows cmd.exe will atomagically insert
proper quotes.

There is no point in explaining basic rules on how to work on the command line
in GnuPG.

x: Do you agree with my conclusion?

I understand your conclusion. I know nothing of GnuPG's demographics other
than what I might guess. If there are a number of users who may be unaware,
then I think that it might be helpful information to include somewhere. I do
think however that to introduce change in the software because of a lack of
knowledge would only contribute to the continued lack of knowledge.

werner claimed this task.