[Samba] Question marks, asterisks, colons in filenames

Ray ray at renegade.zapto.org
Tue Feb 19 12:50:39 MST 2013


at home I only use Linux, so no problem there. Even all my Squeezebox 
radios haven't got any problem with "special" characters, which is not 
really a surprise, because under the hood they also run Linux.

But I also run a site-to-site VPN and at the other sites there are some 
lost souls with Windows boxes.

I've put lots of work into naming all my files as close as possible to 
the original naming (CDs according to CD cover, Movies according to 
IMDB/Wikipedia, and so on). There's absolutely no way that I dump all 
this work and surrender the excellent file naming capabilities of 
ext[34] filesystem's (only "/" not working and for that one there's a 
Unicode replacement) to Windows'/NTFS's poor file naming capabilitis for 
a couple of Windows users.

Samba sits in the middle between the Linux side and the Windows side, 
so to me it would be an obivous functional part of Samba to eliminate 
individual characters from file names that are not permitted in Windows. 
To my understanding this is exactly what "mangled map" did - before it 
was kicked away from Samba's code. Don't get me wrong here: It's 
absolutely ok to kick away obsolete code - but functionally there should 
be some sort of replacement. To my understanding there's nothing new in 
Samba that replaces "magled map": Now users are back to 8.3 name 
hashing. Great. Welcome to DOS - in 2013!

 From the responses I got to my initial question I understand that I 
have to fix the problem on the Linux side: I will write a script that 
copies my directory structure to a different location and eliminates all 
"forbidden characters" from the folder names according to a scheme 
similar to "mangled map". This will fix the folders. Then the script 
will traverse all my directories for files and create hard links for 
each file in the new directory structure. Here, also the "forbidden 
character elimination scheme" will be applied, so in the end I have a 
"Windows-clean' version of my file system (which I can then share out to 
those Windozers) but am still able to keep the properly named files I 

What a royal pain in the behind.

But anyway: thanks for the constructive responses I got.


Am 2013-02-19 17:55, schrieb Rob Townley:
> i bookmarked the #Reserved_characters_and_words section of that wiki 
> article.
> However, the point is, there are times that the end user is not 
> naming
> the files directly, but the OS or an application is doing so.
> wget will put escaped ? into filenames, but a windows machine will 
> not
> be able to read it.
> mkdir "`date`"  allows one to make a folder name based on the time
> with slashes and colons, but of course windows chokes on that.
> Further, file systems need to save time, not consume a weekend.  The
> problem is mostly with NTFS, but we can not control that.  If there
> was a filesystem layer in a samba share that prevented the creation 
> of
> files / folders incompatible with windows, that would save time.  A
> windows filenaming compatibility mode or just get rid of windows and
> Macs altogether.  i prefer the latter, but that would entail getting
> rid of family members and my job.
> On Tue, Feb 19, 2013 at 2:50 AM, L.P.H. van Belle <belle at bazuin.nl> 
> wrote:
>> wel ... just look here whats allowed.
>> http://en.wikipedia.org/wiki/Filename
>> The discussion of * or ? etc, in naming is bad should not be done 
>> here.
>> I had the same with my collection, what is did was, add a new 
>> options in my tagging.
>> artist and albumartist.  where artist is the person whos singing it, 
>> and the albumartist is the
>> person/groep who released it, and i dont use strang ( not allowed )  
>> characters in the albumartist.
>> thats how you can fix it pretty easy.
>> and yes, i have "some" special characters in filenames, but only the 
>> allowed ones.
>> and no, i dont have problems with windows and unix with these files.
>> Louis
>>>-----Oorspronkelijk bericht-----
>>>Van: rob.townley at gmail.com
>>>[mailto:samba-bounces at lists.samba.org] Namens Rob Townley
>>>Verzonden: dinsdag 19 februari 2013 0:34
>>>Aan: Jonathan Buzzard
>>>CC: samba at lists.samba.org
>>>Onderwerp: Re: [Samba] Question marks, asterisks, colons in 
>>> filenames
>>>On Mon, Feb 18, 2013 at 4:56 PM, Jonathan Buzzard
>>><jonathan at buzzard.me.uk> wrote:
>>>> On 18/02/13 19:16, Ray wrote:
>>>>> Hi,
>>>>> I suppose this question must have been posted a hundred times, 
>>>>> but
>>>>> Google brings up nothing useful:
>>>>> Consider "The Wall" from Pink Floyd in an MP3 collection.
>>>There's "In
>>>>> The Flesh.mp3" and "In The Flesh?.mp3" as tracks. Or,
>>>another example in
>>>>> an MP3 collection: There's a Band called "Stellar", but
>>>there's also a
>>>>> band called "Stellar*". Naming files like this is no
>>>problem in Linux.
>>>> Anyone putting "special" characters in file names has a
>>>special place in
>>>> hell reserved for them. It is plain stupid, just don't do it.
>>>> Personally I would name them all wall01.mp3, wall02.mp3 etc.
>>>and add ID3
>>>> tags to them. Any decent graphical file manager and/or music
>>>player will
>>>> display the tag information. Stop abusing the filename to
>>>store metadata
>>>> when there is a standard for storing that metadata in the file.
>>>> JAB.
>>>> --
>>>> Jonathan A. Buzzard                 Email: jonathan (at)
>>>> Fife, United Kingdom.
>>>> --
>>>> To unsubscribe from this list go to the following URL and read the
>>>> instructions:  https://lists.samba.org/mailman/options/samba
>>>JAB, have you ever pulled down a website with wget?  Have you ever
>>>looked at  www.dropbox.com/bad_files_check  which shows all the 
>>> native
>>>files on your Linux box that will never make it to windows.
>>>Is there some kind of regular expression transliterate 
>>> functionality?
>>>A way to force windows only characters for samba shares?
>>>Ray, on more than one occasion swat has documentation that is
>>>nowhere else.
>>>To unsubscribe from this list go to the following URL and read the
>>>instructions:  https://lists.samba.org/mailman/options/samba
>> --
>> To unsubscribe from this list go to the following URL and read the
>> instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list