필터 지우기
필터 지우기

Cannot remove folder that is on Matlab path from outside of Matlab

조회 수: 11 (최근 30일)
Markus
Markus 2019년 2월 11일
답변: Giles 2022년 4월 23일
Hi,
we are using a library that adds folders to the Matlab path. In addition we have an external build system that tries to delete temporary folders before building mex-Files and copying Simulink and Matlab files. For an unknown reason, Matlab prevents the removal of these folder as long they are on the Matlab path. I tried bdclose('all'), clear functions, clear mex, clear all, nothing helps. Why is Matlab preventing the removal?
I also tried to reproduce it manually. But than it works. It happens only with folders that have been added by this library.
Regards
Markus
  댓글 수: 3
Rigel Ifland
Rigel Ifland 2019년 6월 14일
I'm also having this problem, and it's pretty frustrating because it means that if anyone adds my code (stored on a network drive) to their path, I can't delete it until they have closed MATLAB or removed it from their path.
I can reproduce the problem (which seems to do with packages) by creating a few files:
demoFolder
+demoPackage
demoFile.m
If I add demoFolder to the path, I can't delete it from outside MATLAB. Once I remove it from the path I can.
MATLAB 2018b, Windows 10
dpb
dpb 2019년 6월 14일
OTOH, it would be pretty frustrating for the user if they were using said code and all of a sudden it disappears in the middle of something they're doing, too...

댓글을 달려면 로그인하십시오.

답변 (2개)

Markus
Markus 2019년 2월 11일
No, it is mainly matlab and Simulink files. But the problem happens for any folder, no matter if it contains Simulink, Matlab or mex files

Giles
Giles 2022년 4월 23일
I'm having what appears to be the same issue. In my case I've narrowed it down to something pretty simple: If there is a folder that has subfolders, and and at least one subfolder is on the MATLAB search path, then you can't delete the folder when MATLAB is running.
You can delete it if it has no subfolders on the search path, including if only it is on the search path and none of its subfolders.
Any ideas as to why?

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by