Loading…

Kryptel/Java

File Object Names

Names and Unique Names

If you looked into IEncryptedDirectory interface, you might have noticed that some functions require item's name as an argument, and some use item's unique name. So what are they and how do they differ?

Kryptel 7 introduced a new storage format that allowed restoring previously deleted items. The only thing that distinguishes a deleted item from a normal one is EFL_OBJECT_DELETED flag. That immediately led to a problem with file system items – if a file gets replaced, we have two (or more) different files with the same name.

As a solution, Kryptel 7 file agents added a new item property called unique name. If the item is not deleted, that name is the same as the regular item's name. When the items gets deleted, the agent generates a new name, which is guaranteed to be unique. Functions that can work with deleted items, use unique names.

Some functions require specifying unique path. It is simply a path consisting of unique names so that it can address an object inside a deleted directory tree.

IFileSystemAttributes interface has two functions – GetName and GetUniqueName returning the item names.

The last thing worth mentioning is what happens if we try to undelete a file and there exist a file with the same name, which is not deleted. This collision is solved by adding a version number to the name of the file being undeleted.