Search code examples
octavermdir

autoconfir rmdir


i am running a long matlab script and it should run when i am not around. part of the script cleans up previous created folder structures (temp data).

rmdir('dir','s');

however matlabs rmdir will ask me the following:

remove entire contents of dir? (yes or now)

and i need to supply either yes or no to proceed.

i tried piping

pipe(printf('yes'),rmdir('dir','s'));

and other things but nothing works so far.

Problem

how do i autoconfirm with 'yes' to 'rmdir' so my script will not get stopped because of this issue?m


Solution

  • Using confirm_recursive_rmdir you can turn this question on or off. This is a feature of octave, matlab never asks to confirm rmdir