SMB directory listing not alphabetical

TXLoco

Cadet
Joined
May 30, 2023
Messages
4
I have a TrueNAS Core machine hosting a number of shares for my shop. When I do a directory listing on my windows machines, it sorts the directory listing on truenas. However, I have a couple older CNC machines that are reading programs off of my SMB share. I had to turn on Services/SMB/ Enable SMB1 so the CNC machines could log into my server. However, when I hit the share from my CNC, the directory is not sorted. I have very limited access to the computer on the CNC, so I cannot go in and change settings on it.

When I used to have my Programs share on a windows machine and would log into the windows share from the CNC, (using simple share) the directory listing on the CNC is sorted.

The CNC machine has no way for me to control/sort etc. It just shows what the server is putting out. (windows share read by the CNC is sorted, SMB share on truenas read by the CNC is not sorted)

Any suggestions?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I have a TrueNAS Core machine hosting a number of shares for my shop. When I do a directory listing on my windows machines, it sorts the directory listing on truenas. However, I have a couple older CNC machines that are reading programs off of my SMB share. I had to turn on Services/SMB/ Enable SMB1 so the CNC machines could log into my server. However, when I hit the share from my CNC, the directory is not sorted. I have very limited access to the computer on the CNC, so I cannot go in and change settings on it.

When I used to have my Programs share on a windows machine and would log into the windows share from the CNC, (using simple share) the directory listing on the CNC is sorted.

The CNC machine has no way for me to control/sort etc. It just shows what the server is putting out. (windows share read by the CNC is sorted, SMB share on truenas read by the CNC is not sorted)

Any suggestions?
Alphabetical sorting is something generally handled client-side. Server response is not sorted at all (and is not required by SMB protocol or Microsoft's other protocol documentation).
 

TXLoco

Cadet
Joined
May 30, 2023
Messages
4
While this is true, the client usually sorts the directory, but if I do a simple share on a windows box, the listing on the cnc machine is sorted. If I do it off of a SMB machine (Truenas or linux), the listing is not sorted. So I wonder why it's sorted on one but not the other. Is there something else???
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
While this is true, the client usually sorts the directory, but if I do a simple share on a windows box, the listing on the cnc machine is sorted. If I do it off of a SMB machine (Truenas or linux), the listing is not sorted. So I wonder why it's sorted on one but not the other. Is there something else???
Different operating systems and probably poor design decisions by original developer of the CNC software. Samba technically has a vfs module vfs_dirsort that's supposed to sort dir contents prior to sending over wire, but it is unstable and unsupported on TrueNAS. You might have better luck with plain Linux.
 
Top