Rclone copy between 2 Macs - can Icon files be copied correctly?

I'm running rclone copy where the source is a Mac, and the destination is a Mac (configured as an sftp remote).

I'm copying folders which have custom icons - i.e. a hidden "Icon?" file is in the folder. After copying completes, those files on the destination are named "Icon␍" instead, and have a file size of 0.

Is there a way to use rclone copy so these files are copied correctly, and the folders on the destination get their custom icons? Thanks!

Short answer is no.

You could manage probably the ? issue with tweaking encoding but it won't fix your problem. rclone and sftp do not support extended attributes which are needed for Icon? magic to work on macOS.

BTW. If these are two local Macs I think easier would be to use SMB folder sharing instead of rclone. If they are remote you could try program like syncthing (I think it handles ext attr well)

I thought that the attributes appeared as separate files (apple double format) which could be synced by rclone, but I'm probably wrong about that!

@mstgrv how are you seeing the ? If it is via rclone then that is how it will show those Icon files as they have a carriage return on the end of the name. I think an rclone copy via sftp from mac should preserve the file names as there shouldn't be any encoding in use.

What does

rclone help flags local-encoding

say? I'm interested in what the defaults are like this

  --local-encoding MultiEncoder   The encoding for the backend (default Slash,Dot)

I have tried to copy locally (macOS),

rclone copy Dir1 Dir2

directory with customised icon (containing Icon? file). All files are copied but all xattr are lost and of course directory customisation is gone.

I do not consider it a bug really - absolutely no expectations for rclone to replace cp

I have a dev Mac now so I'll give this a try.

How do you make a customised icon like that?

Are resource files used often in modern macs? I get the impression that it is pretty much only custom icons nowadays.

I'd like rclone to be able to copy these if it isn't too hard!

  1. copy some image to clipboard

  2. in finder right click at a folder -> and click Get Info

  3. click folder icon

  1. Paste (⌘-C)

  2. Done

You won't see Icon? file in the Finder - but it is visible in shell.

Actually a lot of apps use them for their own sometimes peculiar reasons. So when you look around you find them all over the place.

OS itself uses resource forks to store for example compressed data in case when in place compression is used.

But indeed extended attributes are more and more replacing them.

Thanks for the replies!

The does show in rclone's log output on the commandline but it also appears that way in Finder itself on the destination after a copy. Screenshots for you below of the source (which you can see has its custom folder icon, and the "Icon?" file is 63kb in size) and the destination after the copy (which lacks the custom icon, and has the renamed "Icon␍" which is 0kb in size)



@kapitainsky I've used syncthing in the past and it's great, but I still think rclone has unique commands and use cases (e.g. rclone check --one-way) that are very handy to have when want to do a specific thing on the commandline, with quick results. It can be a supplement to syncthing.

It says:

# Backend Flags

Backend only flags. These can be set in the config file also.

      --local-encoding MultiEncoder   The encoding for the backend (default Slash,InvalidUtf8,Dot)

Just wanted to see if there was any progress on this at all? Happy to help push this forward any way I can!

What progress do you expect? rclone as for today does not handle extended attributes well. If it is something you think is important any help is welcomed. All project is open source.

I am afraid that there is gazillion of other things to fix before to worry about some missing folder icon. Said that I am sure that if you provide solution it can be included easily.

submit PR - even if not perfect


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.