File not accepted as valid addition to svn

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

File not accepted as valid addition to svn

Bo Berglund
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

Reply | Threaded
Open this post in threaded view
|

Re: File not accepted as valid addition to svn

Philip Martin
Bo Berglund <[hidden email]> writes:

> 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
Reply | Threaded
Open this post in threaded view
|

Re: File not accepted as valid addition to svn

Bo Berglund
On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
<[hidden email]> wrote:

>Bo Berglund <[hidden email]> writes:
>
>> 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

Reply | Threaded
Open this post in threaded view
|

Re: File not accepted as valid addition to svn

Branko Čibej
On 12.02.2018 18:41, Bo Berglund wrote:

> On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
> <[hidden email]> wrote:
>
>> Bo Berglund <[hidden email]> writes:
>>
>>> 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
Reply | Threaded
Open this post in threaded view
|

Re: File not accepted as valid addition to svn

Nathan Hartman
On Feb 12, 2018, at 5:13 PM, Branko Čibej <[hidden email]> wrote:

>
>> On 12.02.2018 18:41, Bo Berglund wrote:
>> On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
>> <[hidden email]> wrote:
>>
>>> Bo Berglund <[hidden email]> writes:
>>>
>>>> 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.
Reply | Threaded
Open this post in threaded view
|

Re: File not accepted as valid addition to svn

Dave Huang-2
In reply to this post by Bo Berglund
On 2/12/2018 11:41, Bo Berglund wrote:
> On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
> <[hidden email]> wrote:
>
>> '&' 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: [hidden email] |  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++

Reply | Threaded
Open this post in threaded view
|

RE: File not accepted as valid addition to svn

Bert Huijben-5
In reply to this post by Bo Berglund


> -----Original Message-----
> From: Bo Berglund [mailto:[hidden email]]
> Sent: maandag 12 februari 2018 18:42
> To: [hidden email]
> Subject: Re: File not accepted as valid addition to svn
>
> On Mon, 12 Feb 2018 15:54:00 +0000, Philip Martin
> <[hidden email]> wrote:
>
> >Bo Berglund <[hidden email]> writes:
> >
> >> 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