How to copy caja file notes

Forum rules
Before you post please read how to get help
Post Reply
pregrine
Level 1
Level 1
Posts: 17
Joined: Mon Jul 28, 2014 11:48 am

How to copy caja file notes

Post by pregrine » Mon Jun 24, 2019 3:48 pm

Under file / folder properties, caja offers a tab "Notes" to tag the object with some comments.

Unfortunately copying a file / folder does not copy these notes. This is especially ugly, if you want to migrate the whole directory tree to another disk.

I tried to find the location, where these notes are stored - w/o success.

Questions:
- How to copy files including the notes?
- Where are the notes stored?

gm10
Level 17
Level 17
Posts: 7448
Joined: Thu Jun 21, 2018 5:11 pm

Re: How to copy caja file notes

Post by gm10 » Tue Jun 25, 2019 10:08 am

They are stored with the files themselves as attributes of the file. More specifically in the metadata namespace, which is meant to stay with the file when you copy it (as per gio info -w):

Code: Select all

Writable attribute namespaces:
 metadata (string, Copy with file, Keep with file when moved)
However, I tried and could not find a way to copy a file while preserving the metadata using caja, cp -p, rsync or gio copy. Moving the files does preserve the metadata if done with caja or gio move, but not across file system boundaries.

So basically it seems we're looking at a bunch of buggy tools that do not fully support the types of file attributes that they write themselves. The only solution I could think of is to manually re-add the metadata at the destination, but maybe somebody has a better idea - in the meantime I created a quick script to handle that: https://gist.github.com/gm10/bc958a381b ... 238c683058, hope you're comfortable with the command line. ;)
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

pregrine
Level 1
Level 1
Posts: 17
Joined: Mon Jul 28, 2014 11:48 am

Re: How to copy caja file notes

Post by pregrine » Tue Jul 02, 2019 12:50 pm

Thanks for your script.

Next problems: Mint 17 mate doesn't now about gio. It is possible to mount the Mint 19 disk on Mint 17 but not vice versa ¹), so I need gio for Mint 17.

Where to find gio for mint 17?

---
¹) Mounting the luks Mint 17 disk via caja causes the Mint 17 disk to disappear from caja's device list. Dismounting is impossible, since Mint 19 mounts the Mint 17 swap space

gm10
Level 17
Level 17
Posts: 7448
Joined: Thu Jun 21, 2018 5:11 pm

Re: How to copy caja file notes

Post by gm10 » Tue Jul 02, 2019 1:25 pm

- There is no gio on Mint 17 (there was gvfs-info and gvfs-set-attribute but Mint 17 isn't supported anymore, anyway).
- You can edit mount options via Mint menu > Disks. The "Show in user interface" checkbox controls whether you see a mounted device in the file manager.
- You can unmount partitions and swap space in the same tool.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Post Reply

Return to “MATE”