MATLAB: Do RMDIR and DELETE not work correctly with symbolic links in MATLAB 7.0 (R14)

deletelinkMATLABr14r14sp1r14sp2rmdirsymbolicsymlink

RMDIR and DELETE cannot be used to delete a symbolic link within MATLAB 7.0 (R14). For a symbolic link, 'root', to a directory '/home/username/test', the following code:
delete root
produces the following warning:
Warning: 'root' is a directory. Use rmdir to delete directories.
and
rmdir root
produces the following:
Warning: Directory /home/username/test could not be removed.
If it is not empty, use rmdir with 's' option.
??? Error using ==> rmdir
No directories were removed.

Best Answer

We have verified that there is a bug in MATLAB 7.0 (R14) that affects the way RMDIR and DELETE handle symbolic links. To work around this issue, use the system command 'unlink' or 'rm' to remove a symbolic link. This can be done from MATLAB using the following:
!unlink root
or
!rm root