Ticket #50 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 3 months ago

Only one function to add files to a volume

Reported by: bonfire-app@… Owned by: pygi
Priority: minor Milestone:
Component: libisofs [old] Version:
Keywords: Cc:

Description

currently there are two functions to add files to the volume: iso_tree_add_node and iso_tree_radd_dir. There is no point in keeping them both. when you add a directory you want its children. So maybe libisofs should just keep the first one, iso_tree_add_node. After a stat() on the file, if it's a directory, libisofs would add recursively the directory and its children, if not, it just adds the file as is.

Change History

Changed 2 years ago by neeman@…

There is no point in keeping them both. when you add a directory you want its children.

Not necessarily. What if you're writing a GUI burning application and you want to create a virtual directory tree for burning a data disk? Then you may want to create new directories on your disk and fill them manually instead of copying whole directories recursively from the file system.

Changed 2 years ago by bonfire-app@…

What you describe is a bad idea inspired problably by the use of mkisofs. With mkisofs, when you want to create a virtual directory on disc, you create a real empty directory on the hard drive and pass it as an argument.

In fact in an image, a directory only exists by the directory records it has in the directory record entries of his parent. We shouldn't need to create a real directory on the hard drive to have a virtual one on disc.

That's why the authors of libisofs thought about this case since they added the following function specifically for virtual directories : struct iso_tree_node *iso_tree_add_new_dir(struct iso_tree_node *parent,

const char *name);

That way you don't need to create an empty physical directory on hard drive to add a virtual directory to disc.

That's why when you add a _real_ directory, I don't see a case when you don't want to add all his children and therefore having two functions is useless.

Changed 2 years ago by anonymous

sorry, it's been a while since I looked at that part of the code. It seems that iso_tree_radd_dir currently does what you want iso_tree_add_node to do. iso_tree_add_node is used internally by iso_tree_radd_dir. I suppose you could rename iso_tree_add_node to something like iso_tree_add_single_node, make it private to the library and rename iso_tree_radd_dir to iso_tree_add_node.

Changed 3 months ago by vreixo

  • status changed from new to closed
  • resolution set to wontfix

API was changed on ng libisofs. Please check last revision to see if new API is ok for you, and be free to reopen the bug if not.

Note: See TracTickets for help on using tickets.