[Samba] Windows dir command not working on filenames with 8.3 format

Georg georgt at sbox.tugraz.at
Mon Mar 23 13:54:30 GMT 2009


Hi!

I have following setup: A QNAP TS509Pro NAS with Samba version 3.0.23d.

And I have following problem: When issueing a dir command (in 
combination with some wildcards, like *.png) in a Windowsshell, I don´t 
get the desired files back.

First try:

M:\georg\LEMS_png\Aliens>dir /x
  Datenträger in Laufwerk M: ist xxxxxxxxxx
  Volumeseriennummer: 8909-01D0

  Verzeichnis von M:\georg\LEMS_png\Aliens

23.03.2009  14:05    <DIR>                       .
23.03.2009  14:13    <DIR>                       ..
23.03.2009  14:05               389              Alien054.png
23.03.2009  14:05               500              Alien077.png
23.03.2009  14:05               408              Alien003.png
23.03.2009  14:05               470              Alien010.png
23.03.2009  14:05               416              Alien070.png
23.03.2009  14:05               363              Alien024.png
23.03.2009  14:05               548              Alien006.png
23.03.2009  14:05               428              Alien002.png
23.03.2009  14:05               383              Alien043.png
23.03.2009  14:05               413              Alien042.png

=======>

Second try:

M:\georg\LEMS_png\Aliens>dir /x *.png
  Datenträger in Laufwerk M: ist xxxxxxxxxxxx
  Volumeseriennummer: 8909-01D0

  Verzeichnis von M:\georg\LEMS_png\Aliens

Datei nicht gefunden

=====> No file found

I found out, that samba somehow assigns a short filename to longer 
filenames:

M:\georg\LEMS_png\Butterfly>dir /x
  Datenträger in Laufwerk M: ist xxxxxxxxxx
  Volumeseriennummer: 8909-01D0

  Verzeichnis von M:\georg\LEMS_png\Butterfly

16.03.2009  22:14    <DIR>                       .
23.03.2009  14:13    <DIR>                       ..
16.03.2009  22:14               473 BJS2AV~R.PNG Butterfly-a065.png
16.03.2009  22:14               328 BJI2P8~A.PNG Butterfly-a055.png
16.03.2009  22:14               475 BKM13Z~I.PNG Butterfly-a095.png
16.03.2009  22:14               342 BJ833G~O.PNG Butterfly-a044.png
16.03.2009  22:14               439 BK21WJ~W.PNG Butterfly-a079.png
16.03.2009  22:14               477 BK21WJ~X.PNG Butterfly-a078.png
16.03.2009  22:14               479 BKC1IB~J.PNG Butterfly-a087.png


In this case at least the dir *.png command works.

It seems there are two fields for a file: One with the long filename and 
one with the 8.3 filename.

The questions are:

-) If I would issue above commands on a local drive, it would work as 
exepected: All the files are shown, and the order is also correct (like 
Alien002.png would be before Alien006.png). Why is there a difference?

-) Can I tell samba to also "translate" or copy 8.3 filenames to the 8.3 
field, if yes how?

-) Is there a way to tell dir what field to use?

Hopefully my problem is stated clearly.

Thanks in advance,
Georg



More information about the samba mailing list