Closed simont closed 8 years ago
No recursive flag when deleting collection with sub collections or data objects might fail... I'll need to look into this since I don't know the behavior. I like your proposed interface, and maybe there could be other helper functions that have force and recursive defaults defined.
$ irm -f test-dir
ERROR: rmCollUtil: -r option must be used for collection /tempZone/home/admin/test-dir
ERROR: rmUtil: rm error for /tempZone/home/admin/test-dir, status = -318000 status = -318000 USER_INPUT_OPTION_ERR
"irm" without the recursive flag on a collection fails, regardless of contents.
Note: Also need to consider "irmtrash" functionality.
Proposed IRodsObj interface additions:
// irm -rf
Destroy() error
// irm -f {-r}
Delete(recursive bool) error
// irm {-r}
Trash(recursive bool) error
// irm {-r} {-f}
Rm(recursive bool, force bool) error
Following on from the ability to create collections, we're going to need to be able to delete collections from iRODS, similar to the iRODS
irm
function.https://docs.irods.org/4.1.8/icommands/user/#irm
Likely options we'll need would include:
The method signature might be something like this:
func (col *Collection) Delete(force bool, recursive bool) error
S.