copy files with long file names from mac to NAS

Hi,

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 ?

thanks.

Try to find out what makes ext4 puke on the files. Have you tried low level commands like ditto?

name too long > 255 chars
I tried cp and rsync same problem error 50 from the finder also.

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:

are you saying your filenames DO exceed 255 char?
if so, thats your problem, as EXT4 has a 255 limit

I think Windows it still limited to 255 character path names, not file names. My app is no use if the path is too long.

[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?

In the upcoming edition of xDevMag, I’ll show you how to fix a lot of the controls, but the list of header is not one that I could solve.

Icons in the list box are solved by drawing them yourself.

I’m currently working through some PopOver issues at the moment.

There’s also some consistency issues between the dark mode on pre-Mojave and Mojave, which I’m also working through.

@Sam Rowlands: you are in the wrong topic :slight_smile:

[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 !

Oops… How embarrassing, sorry folks.

I made my own tool to reduce the filename length to … 127 chars as the qnap is only accepting that !

Again a clever (with irony) spammer.