Discussion:
File not accepted as valid addition to svn
Bo Berglund
2018-02-12 14:57:27 UTC
Permalink
Today I found that there is a problem with some files in regards to
the svn add command (on Windows 7):

svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
svn: E200009: Could not add all targets because some targets don't
exist
svn: E200009: Illegal target for the requested operation
'Attefalltillbyggnad.pdf' is not recognized as an internal or external
command,
operable program or batch file.

Why does this happen? The & character is a fully legal part of a file
name at least on Windows...
I tried to find a list of characters that Subversion does not like,
but apparently there is none. So is it in fact not possible to use &
inside a file name in Svn (1.9.7)?
Is there a workaround? (I replaced the & with a hyphen just to be able
to continue, but got curious...

While googling I found that trying to create a seemingly innocent file
by name aux.txt also fails! It was mentioned as one of the
(undocumented) "features" of Windows. I tried and sure enough there
was an error.
--
Bo Berglund
Developer in Sweden
Philip Martin
2018-02-12 15:54:00 UTC
Permalink
Post by Bo Berglund
svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
'&' has special meaning to the shell and needs to be quoted or escaped.
--
Philip
Bo Berglund
2018-02-12 17:41:42 UTC
Permalink
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
Post by Philip Martin
Post by Bo Berglund
svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
'&' has special meaning to the shell and needs to be quoted or escaped.
I always thought that this was the case only for Linux, since & is a
perfectly valid part of a file name on Windows...
But I will refrain from such characters in paths in the future.
--
Bo Berglund
Developer in Sweden
Branko Čibej
2018-02-12 22:13:37 UTC
Permalink
Post by Bo Berglund
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
Post by Philip Martin
Post by Bo Berglund
svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
'&' has special meaning to the shell and needs to be quoted or escaped.
I always thought that this was the case only for Linux, since & is a
perfectly valid part of a file name on Windows...
But I will refrain from such characters in paths in the future.
The Windows shell has special characters, too. As far as file names are
concerned, Unix filesystems typically allow _more_ characters than
Windows filesystems.

-- Brane
Nathan Hartman
2018-02-13 03:25:14 UTC
Permalink
Post by Branko Čibej
Post by Bo Berglund
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
Post by Philip Martin
Post by Bo Berglund
svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
'&' has special meaning to the shell and needs to be quoted or escaped.
I always thought that this was the case only for Linux, since & is a
perfectly valid part of a file name on Windows...
But I will refrain from such characters in paths in the future.
The Windows shell has special characters, too. As far as file names are
concerned, Unix filesystems typically allow _more_ characters than
Windows filesystems.
Nevertheless I try to avoid filenames that create difficulties under either system because we have a mix Windows, Mac, and *nix. Each comes with its idiosyncrasies. Oh, and sometimes build systems don't escape everything correctly. Just my 2 cents.
Dave Huang
2018-02-13 17:33:41 UTC
Permalink
Post by Bo Berglund
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
Post by Philip Martin
'&' has special meaning to the shell and needs to be quoted or escaped.
I always thought that this was the case only for Linux, since & is a
perfectly valid part of a file name on Windows...
But I will refrain from such characters in paths in the future.
& is valid for a filename on Linux too, but it also needs to be escaped
there... if you run "help cmd" in Windows, it says at the end:

The special characters that require quotes are:
     <space>
     &()[]{}^=;!'+,`~

The & in Windows is a command separator, basically like ";" in
Unix-style shells. So

svn add Fasadändring&Attefalltillbyggnad.pdf

Is interpreted as "svn add Fasadändring" followed by "Attefalltillbyggnad.pdf". The first results in "svn: warning: W155010: 'D:\Bosse\Fasadändring' not found", and the second results in "'Attefalltillbyggnad.pdf' is not recognized as an internal or external command, operable program or batch file."

Also, "^" is the escape character for cmd.exe (like "\" in Unix shells), so as an alternative to quoting the filename, you can do:

svn add Fasadändring^&Attefalltillbyggnad.pdf
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: ***@azeotrope.org | they raise a paw / the bat, the cat /
Telegram: @dahanc | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 41 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
Bert Huijben
2018-02-16 17:54:20 UTC
Permalink
-----Original Message-----
Sent: maandag 12 februari 2018 18:42
Subject: Re: File not accepted as valid addition to svn
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
Post by Philip Martin
Post by Bo Berglund
svn add Fasadändring&Attefalltillbyggnad.pdf
svn: warning: W155010: 'D:\Bosse\Fasadändring' not found
'&' has special meaning to the shell and needs to be quoted or escaped.
I always thought that this was the case only for Linux, since & is a
perfectly valid part of a file name on Windows...
But I will refrain from such characters in paths in the future.
F:\>echo q&r
q
'r' is not recognized as an internal or external command,
operable program or batch file.

F:\>


It is a separator between multiple operations on the same line. You could
quote the argument with "-characters, which usually just pressing TAB would
do for you on Windows if the file exists. Another option is adding a ^ in
front of the &.

Bert

Loading...