Accessing long filenames (directories) via SMB

Windows can enable long filename support via the registry, but long filenames are not supported in TrueNAS and SMB access. I’m not sure which side is causing the problem, but I’d like to know if it’s possible to improve this in the future.

1 Like

How long of filenames are we talking about? The problem generally is that it’s one thing to do this on a local filesystem, and another to do it on a server. In the latter case you start breaking clients in new and interesting ways if they don’t expect the change. Are you talking about path length or actual length of the file’s name?

The complete filename (including the directory) would look something like: /mnt/pool/longfoldername/longfilename.mp4

In an SMB share, it would typically be \server\Data\Video\longfoldername/longfilename.mp4

More than 256 bytes in a file name is not going to happen. It will most likely break a large number of SMB clients. Longer paths with multiple components is possible.

```
smb: \aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb> allinfo foo
altname: foo
create_time: Tue Nov 25 20:22:24 2025 CST
access_time: Tue Nov 25 20:22:24 2025 CST
write_time: Tue Nov 25 20:22:24 2025 CST
change_time: Tue Nov 25 20:22:24 2025 CST
attributes: A (20)
```
Have you tested this?

Yes, the actual issue is an excessively long path. On Windows, removing the path length limit (MAX_PATH) allows files to be read and written normally on the local disk, but when I try to move the file to the TrueNAS’s SMB, it fails to write.

I recently searched for software issues and found that its users and developers have already resolved the issue of the software reading long-path files via SMB, so I believe this might be a Samba or TrueNAS problem.

I also tested it; on a Windows server with long path support enabled, another Windows machine with long path support enabled can access the SMB share normally. The Android app can also access it normally.

Is that the registry edit? If so, I wouldn’t say that it’s been resolved in a way that Microsoft feels is good enough. When they feel confident with it I would expect them to enable it by default.