-
Notifications
You must be signed in to change notification settings - Fork 2
Tag Namespaces
WXY edited this page May 10, 2020
·
1 revision
Upon creating some tags you may have noticed a file named .tagnames
being created.
- This file is the basis of a
tag namespace
- Do not delete this file. Doing so will effectively wipe out all tags in the directory and its descendants.
The reason why we need .tagnames
is because we don't store the tag names on the files.
- To save space, whenever a file is tagged, we attach a 16 bit ID to it. This amounts to a space usage of 4 characters per tag.
- More importantly, to rename a tag we make one simple change to
.tagnames
. Instead of finding and updating every file that would've been affected.- The most clear benefit of this is that people whom store some of their files in removable storage don't need to mount it in order to rename or create new tags.
So what is a tag namespace?
- A directory that contains a
.tagnames
file. - All files in that directory and its descendant directories will all use the same file to assign & translate tag IDs to text
Say that Leonard's directory tree looks like this
- /home/leonard (or C:\Users\leonard for windows)
.tagnames
- Pictures
- photo1.jpeg
- Books
.tagnames
- book1-page1.jpeg
- Downloads
- picture1.jpeg
There are two namespaces in this directory tree
/home/leonard
- If leonard opened
Pictures
,Downloads
, or his home directory then he would see the same tags show up as filterable tags.
/home/leonard/Books
- However if
Books
is opened instead, then a set of tags unique to files inBooks
will be shown instead
Note that files can not move between namespaces yet. And that files tagged in one namespace can not be moved out of it. Though the .tagnames
file can be moved up in the directory tree to make it available to more directories. However the "nearest parent" search rule still applies.