vertexdb icon indicating copy to clipboard operation
vertexdb copied to clipboard

No strict distinction between "files" and "directories"

Open hassy opened this issue 15 years ago • 1 comments

It's possible to create a file and a directory with the same name. The key does not show up in op pairs/keys when there's a directory with the same name. rm'ing the key removes the directory too.

Is this intentional?

URL with("http://localhost:8080/dir?action=mkdir") fetch
// ==> null
URL with("http://localhost:8080/?action=write&key=dir") post ("dir_val")
// ==> null
// Can read the key "dir" now:
URL with("http://localhost:8080/?action=read&key=dir") fetch
// ==> "dir_val"
// But it does not show up in pairs:
URL with("http://localhost:8080/?action=select&op=pairs") fetch
// ==> [["dir",{}]]
// rm'ing the key removes both the key-value pair, AND the directory.
URL with("http://localhost:8080/?action=rm&key=dir") fetch
// ==> null
URL with("http://localhost:8080/?action=read&key=dir") fetch
// ==> null
URL with("http://localhost:8080/?action=select&op=pairs") fetch
// ==> []

hassy avatar Oct 24 '09 16:10 hassy

This was done to simplify implementation. The convention is to use _name for files and name for directories. The select operation (and others?) use this convention to determine their output. In the future, this info will be stored in the metadata for the nodes.

richcollins avatar Oct 24 '09 19:10 richcollins