Add a New Comment (Rich Markup)
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.
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.
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.
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.
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
(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
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.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 2 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11