I’m copying a big bunch of files from a mac os x server to a brand new qnap NAS
I’m facing the problem : there are some files ( a few hundreds) with long file names (on a total of some 1.6 millions files…)
mac os (afp) handle these files with no problem, but the NAS as an ext4 file system refuses them.
I learned about the robocopy (windows tool) that can copy these files ? (how ?)
is there an utility that copies these files and just truncate the names ?
or do I have to make such an app for mac os ?
I wrote a Xojo app called FileName Extreme that allows you to change the names/extensions of files. It also allows you to truncate the length of file names. You could run this (pre-registration) on your original drive to preview all the files that are too long.
Here I set the limit to 31 characters:
[quote=393950:@Dave S]are you saying your filenames DO exceed 255 char?
if so, thats your problem, as EXT4 has a 255 limit[/quote]
there is one file I isolated unable to copy it from mac to NAS
the filename is 200 chars long, and with the folders I did not count but it should be near 255 chars.
There is also the possibility that it can’t handle some special characters (invisible ones, “odd ones”, back/slashes, …) in the filename… Could that be the case with the file you’ve found?
I’ve tried that. removing random characters word by word finally accept the copy. it only seems to be a length problem.
also if I connect to the NAS with samba, I get a better error message than from AFP (where I get a nice “error 50”)
I’ve also opened the filename with an hex dump utility and I don’t have any control characters, it’s all UTF8.
It may be the API you’re using that’s the problem here, i.e. that a different API might work better.
Also, are you now sure that the issue is that the path length exceeds 255 bytes?
In that case, what API are you using to create or copy the file on the destination volume? Xojo’s FolderItem? Or do you use a cmdline tool? Or is this not about Xojo at all and this should be moved to the off-topic section?
[quote=394028:@Thomas Tempelmann]It may be the API you’re using that’s the problem here, i.e. that a different API might work better.
Also, are you now sure that the issue is that the path length exceeds 255 bytes?
In that case, what API are you using to create or copy the file on the destination volume? Xojo’s FolderItem? Or do you use a cmdline tool? Or is this not about Xojo at all and this should be moved to the off-topic section?[/quote]
I’m simply using the macos finder !