bugGNU Octave - Bugs: bug #56334, rmdir asks for for confirmation...

 
 

bug #56334: rmdir asks for for confirmation before recursively removing a directory

Submitter:  Guillaume <gyom>
Submitted:  Thu 16 May 2019 03:39:38 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 15 Jan 2024 03:30:23 AM UTC, comment #5: 

The Octave default is cautious, prompt before a potentially catastrophic deletion of an entire directory tree.  This reflects a philosophical point of view.  Given how easy it is to change the default to be whatever the user wants via an .octaverc file, I don't think we need to change Octave's default position.

Closing report.

Rik <rik5>
Group administrator
Thu 16 May 2019 06:34:39 PM UTC, comment #4: 

I just confirmed that all Octave and Octave Forge code that uses 'rmdir (dir, "s")' also sets the 'confirm_recursive_rmdir' flag to false locally before the call. So all existing code wants the prompt to be disabled, and no Octave code would be affected by changing the default or removing the prompt entirely.

So the only issue is the behavior for interactive users of Octave, and it seems that Octave intentionally added this prompt to be user friendly, with the option to disable it for Matlab compatible behavior. I would prefer the prompt disabled, and you would, but that's also easy enough to do with an octaverc file. Deciding to change defaults should probably be discussed on the maintainers mailing list.

Mike Miller <mtmiller>
Group Member
Thu 16 May 2019 06:28:31 PM UTC, comment #3: 

Also not that 'octave --traditional' sets the 'confirm_recursive_rmdir' flag to false, so the prompt is not shown, until now this has been considered enough for full compatibility I suppose.

Mike Miller <mtmiller>
Group Member
Thu 16 May 2019 06:27:04 PM UTC, comment #2: 

Oh, do you mean the confirmation prompt that shows when a user uses 'rmdir dir s'? If so, then yes I agree that should be changed. We should also inspect other Octave functions that may use rmdir with the 's' option and see if they expect the prompt to be shown, and decide whether it's appropriate to add a prompt there.

Mike Miller <mtmiller>
Group Member
Thu 16 May 2019 06:23:24 PM UTC, comment #1: 

That doesn't seem to match the documented behavior on

https://www.mathworks.com/help/matlab/ref/rmdir.html

> rmdir folderName removes the folder folderName from the current folder. folderName must be empty. If the operation is not successful, MATLABĀ® throws an error to the Command Window.
> rmdir folderName s also attempts to remove all subfolders and files in folderName, regardless of their write permissions. The result for read-only files follows the practices of the operating system.


That seems exactly like how Octave rmdir works.

Mike Miller <mtmiller>
Group Member
Thu 16 May 2019 03:39:38 PM UTC, original submission:  

By default, rmdir() asks for confirmation before recursively removing a directory whereas Matlab does not. For compatibility, I would suggest switching the default value here:

https://hg.savannah.gnu.org/hgweb/octave/file/9326c2258e60/libinterp/corefcn/dirfns.cc#l66

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-15 rik5 StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2019-05-16 mtmiller StatusWorks For Me Need Info
    2019-05-16 mtmiller StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-461b.
    Corresponding source code