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:  Need Info Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

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


> 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:


Guillaume <gyom>


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

Attach Files:

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 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 project members can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.12.
    Corresponding source code