irods / irods_client_icommands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create icommand irmdir

rskarbez opened this issue · comments

Functionality would be the same as Unix rmdir.

Requested in irods/irods#3117.

please cherry-pick to 4-2-stable

Thanks for implementing it. I skimmed the code (possibly misunderstanding it in the process) and wondered, does it give the same safety guarantees as the POSIX equivalent?

  1. check the collection is empty - yes.
  2. equivalent to irm -r, wrapped as irmdir

This is fine until,

  1. without getting an exclusive lock on the collection,
  2. check the collection is empty - yes.
  3. some other client sneaks in and writes a file
  4. equivalent to irm -r, wrapped as irmdir
  5. disappointment and data loss?

Could you make the safety guarantee, or lack of, explicit in the irmdir -h text please?

Thanks for checking this; I hadn't considered that potential case. I will certainly update the help text, and will look into what it would take to make the equivalent safety guarantees as the POSIX equivalent.