[Samba] folder name screwed up

Toby Ovod-Everett toby at ovod-everett.org
Wed Aug 14 10:20:31 MDT 2013


On Wed, Aug 14, 2013 at 06:02:49PM +0200, patrick wrote:
> >>>on my linux box i can see the folder as: "1996 - E.I.N.S."
> >>>on my windows 7 box it is show as: "1MNOXH~A"
> >>
> >>what about the dot at the end of the folder name?
> >
> >ah. yes thats the problem. never occoured to me to google for
> >"period at the end of folder in same"
> >mangled names = no
> >in the config fixes the problem, thx.
> 
> hm, should have tested it...now i cant access the folder but it
> shows correctly.
> for now i will just remove the dot at the end, at least i can access
> the folder.

>From a Command Prompt against the local file system on a Windows 7 machine:

C:\Users\Toby\Desktop>md "Foo."

C:\Users\Toby\Desktop>dir Fo*
 Volume in drive C has no label.
 Volume Serial Number is 268D-BDFD

 Directory of C:\Users\Toby\Desktop

08/14/2013  08:10 AM    <DIR>          Foo
               0 File(s)              0 bytes
               1 Dir(s)  74,288,111,616 bytes free

C:\Users\Toby\Desktop>cd "Foo."

C:\Users\Toby\Desktop\Foo>cd ..

C:\Users\Toby\Desktop>rd Foo

C:\Users\Toby\Desktop>md "\\?\C:\Users\Toby\Desktop\Foo."

C:\Users\Toby\Desktop>dir Fo*
 Volume in drive C has no label.
 Volume Serial Number is 268D-BDFD

 Directory of C:\Users\Toby\Desktop

08/14/2013  08:11 AM    <DIR>          Foo.
               0 File(s)              0 bytes
               1 Dir(s)  74,287,034,368 bytes free

C:\Users\Toby\Desktop>cd "Foo."
The system cannot find the path specified.

C:\Users\Toby\Desktop>cd "\\?\C:\Users\Toby\Desktop\Foo."
'\\?\C:\Users\Toby\Desktop\Foo.'
CMD does not support UNC paths as current directories.

C:\Users\Toby\Desktop>dir "\\?\C:\Users\Toby\Desktop\Foo."
 Volume in drive \\?\C: has no label.
 Volume Serial Number is 268D-BDFD

 Directory of \\?\C:\Users\Toby\Desktop\Foo

File Not Found

C:\Users\Toby\Desktop>rd "\\?\C:\Users\Toby\Desktop\Foo."


Windows doesn't really like filenames that end in "." - they aren't valid in
the "normal" filesystem calls.  This is probably due to the whole 8.3 naming
convention history - maybe DOS didn't store the . and simply stored the first
8 chars and the 3 chars for the extension and had a standard of not displaying
the trailing period if the extension was missing.

See http://msdn.microsoft.com/en-us/library/aa365247.aspx#namespaces for some
more information.  It appears that Windows strips trailing periods in normal
calls, and so while it can display the directory with a trailing period, it
can't access it unless you use the "\\?\" prefix to escape the name
normalization code and speak directly to the filesystem.  On the other hand,
that means you have to use fully-qualified filenames for everything.

Also note the following spotted in
http://msdn.microsoft.com/en-us/library/aa365247.aspx#naming_conventions:

    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".

--Toby Ovod-Everett


More information about the samba mailing list