[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Files ending with . (dot) on Windows

From: Ryan Schmidt <subversion-2012c_at_ryandesign.com>
Date: Thu, 11 Jul 2013 17:42:36 -0500

On Jul 11, 2013, at 14:31, "Staton, Bradley D." wrote:

> We recently added files from a 3rd party tool to our repository and some
> of the file names end with . (dot). On UNIX systems, this is perfectly
> fine and everyone is happy, but on Windows systems the files are
> reported as missing and a corresponding file without the . at the end of
> the file name is listed as not being under version control (with SVN
> 1.6.17 client) or the repository just can't be checked out (with SVN
> 1.8.0 client).
>
> This doesn't appear to be a bug in Subversion, as Windows doesn't allow
> files to end with a dot and doesn't seem to handle them gracefully when
> they do. From http://msdn.microsoft.com/en-us/library/aa365247.aspx:
>
> "Do not end a file or directory name with a space or a period. Although
> the underlying file system may support such names, the Windows shell and
> user interface does not. However, it is acceptable to specify a period
> as the first character of a name. For example, ".temp"."
>
> Here's a simple walkthrough that demonstrates the behavior:
>
> On a UNIX system add a file with a name ending in . to the repository:
>
> -bash-3.00$ touch src/main/resources/fileEndingWithDot.
> -bash-3.00$ svn status
> ? src/main/resources/fileEndingWithDot.
> -bash-3.00$ svn add src/main/resources/fileEndingWithDot.
> A src/main/resources/fileEndingWithDot.
> -bash-3.00$ svn commit . -m "Adding a file with name ending in dot to
> demonstrate behavior on Windows"
> Adding src/main/resources/fileEndingWithDot.
> Transmitting file data
> Committed revision 22.
> -bash-3.00$ svn status
> -bash-3.00$
>
> As you can see, everything works as expected.
>
> When using an older svn client on Windows (svn, version 1.6.17
> (r1128011) compiled Jun 2 2011, 23:35:08, Copyright (C) 2000-2009
> CollabNet) it's possible to check out the repository:
>
> C:\tmp\playrepo>svn co <path/to/repo/>/trunk
> A trunk\.classpath
> A trunk\.project
> A trunk\src
> A trunk\src\test
> A trunk\src\test\java
> A trunk\src\test\resources
> A trunk\src\main
> A trunk\src\main\java
> A trunk\src\main\java\com
> A trunk\src\main\java\com\saic
> A trunk\src\main\java\com\saic\isd
> A trunk\src\main\java\com\saic\isd\TestInterface.java
> A trunk\src\main\java\com\saic\isd\HelloWorld.java
> A trunk\src\main\resources
> A trunk\src\main\resources\fileEndingWithDot.
> A trunk\pom.xml
> U trunk
> Checked out revision 22.
>
> But users constantly get a misleading status on the files with problem
> file names.
>
> C:\tmp\playrepo\trunk>svn status
> ? src\main\resources\fileEndingWithDot
> ! src\main\resources\fileEndingWithDot.
> C:\tmp\playrepo\trunk>
>
> In a recent svn client on Windows (svn, version 1.8.0 (r1490375)
> compiled Jun 17 2013, 08:08:13 on x86-microsoft-windows, Copyright (C)
> 2013 The Apache Software Foundation) attempting to check out the
> repository fails:
>
> C:\tmp\playrepo>svn co <path/to/repo/>/trunk
> A trunk\.classpath
> A trunk\.project
> A trunk\src
> A trunk\src\test
> A trunk\src\test\java
> A trunk\src\test\resources
> A trunk\src\main
> A trunk\src\main\java
> A trunk\src\main\java\com
> A trunk\src\main\java\com\saic
> A trunk\src\main\java\com\saic\isd
> A trunk\src\main\java\com\saic\isd\TestInterface.java
> A trunk\src\main\java\com\saic\isd\HelloWorld.java
> A trunk\src\main\resources
> svn: E155000: 'fileEndingWithDot.' is not valid as filename in directory
> 'C:\tmp\playrepo\trunk\src\main\resources'
>
> Is there a known work around for this? Was there a conscious decision
> between 1.6 and 1.8 to change this behavior, or have I stumbled across a
> bug? Our Windows users can continue to use the older svn client so that
> working with the repo is still possible, but they'd like to stop seeing
> the missing/not controlled status messages. Normally, I'd just rename
> the files to something that both platforms can handle, but since these
> files are delivered from a 3rd party I'd like to avoid that if at all
> possible.

I'm surprised it worked on Windows with Subversion 1.6. I doubt there was a conscious decision to change this in Subversion; it's probably just a consequence of the new working copy code ("wcng") in 1.7.

There are many filenames that are forbidden on Windows. If you want your repository to be compatible with Windows clients, you should not use such names.

Since these files were provided by a third-party library, you should refer the authors of the third-party library to the Microsoft documentation on legal filenames and ask them to rename the files in their next release.

You could write a pre-commit hook to prevent other files whose names are illegal on Windows from making their way into your repository.
Received on 2013-07-12 00:43:30 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.