Ticket #132 (closed enhancement: fixed)
Confusing error reply by iso_tree_add_node(), inability to graft in what i want
| Reported by: | scdbackup | Owned by: | vreixo |
|---|---|---|---|
| Priority: | critical | Milestone: | libisofs-0.6.4 |
| Component: | libisofs | Version: | libisofs-0.6.3 |
| Keywords: | Cc: |
Description
When i add a node refering to a disk file with the same leafname as an existing node in the same directory, then this fails with ISO_NODE_NAME_NOT_UNIQUE.
Understandable, as by default the new node would get the same name as the existing one.
But that is not my intention. I just do not have a chance to tell libisofs the intended Rock Ridge name before i create the node from the disk object. Only afterwards i can set the intended name, which i checked before that it does not exist yet in the directory.
This leads to two application programmer complaints:
- the return value of iso_tree_add_node() is very confusing, especially if i just removed the old node with the _intended_ name (not the one with the disk leafname).
- since there seems to be no way to set the Rock Ridge name before creating the node, i am effectively unable to map a disk file into an ISO directory if that directory happens to contain that file's leafname as RR name. Although i did not indicate in any way that i want the new node to have the same name.
Remedy proposals:
1) In iso_tree_add_node() give the new node some unique default name rather than to return error.
2) Introduce new API call which allows to create a IsoFile with an explicit RR leafname independent of the disk path. Deprecate iso_tree_add_node(). This call should return error if the RR leafname already exists.
