automatically delete .m files when exit MATLAB
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I edit .m files in my laptop, upload them onto a work computer and open them on the work computer. When I exit MATLAB, these files are deleted automatically with out any warning. Only the files uploaded from a remote computer meet this problem, while those files created locally not. How can I fix it?
0 Kommentare
Antworten (3)
Jan
am 1 Mär. 2016
It is unlikely, that Matlab deletes files. And it is hard to believe, that Matlab decides, which files are deleted, according to the way they have been created. Whenever such a magic behavior occurres, there have been real and clear reasons, but the user has not recognized them yet.
So please look in the file finish.m if it contains any strange code which deletes M-files. How do you upload the files? Can you confirm, that the files are really really really deleted when Matlab exits? What happens, if you upload the files and restart the machine without staring Matlab?
Where are the files saved? On a local disk or in a network? Check the logs of the virus scanner.
Jos (10584)
am 2 Mär. 2016
Could this be related to the back-up files that can be automatically created and deleted when you edit them? Take a look at your settings for the editor/debugger.
0 Kommentare
Misun Kim
am 6 Okt. 2018
I experienced the same problem and I could replicate the problem sometimes (but not always).
1. Create a matlab script from my laptop- "machine A"(e.g. C:Directory1/testScript.m) Version: MATLAB2014a, Windows10 pro - Surface Book.
2. Open a remote desktop for other Window PC-"machine B" (MATLAB2014a, Windows8.1 Enterprise)
3. Copy and paste the script (by pressing ctrl+CV) to the local directory of machine B, (e.g. D:/Experiment1/testScript.m)
3. Edit the script in the remote desktop (machine B).
4. Close the MATLAB in machine B. Then MATLAB will ask whether you want to save the change. Click yes.
5. Sometimes, the edited script (testScript.m) in machine B is instantly and permanently deleted when MATLAB closes (as if .asv files).
As Feng Junya and Jos suggested, I think it is related to autosave file and unknown bug with file transfer in Windows remote desktop. I have not yet tested the 'disable MATLAB default setup for deleting autosave file when MATLAB is closed'. It is even more frustrating because this problem happens only occasionally. It would be easier to discover the bug and fix the problem if I can replicate every time. It is very scary and frustrating that it can happen. (I already lost my important script)
I hope this issue can be resolved soon Any advice will be greatly appreciated!
1 Kommentar
Misun Kim
am 6 Okt. 2018
It might not be the m-file autosave issue, rather more complicated temporary file issues. I copied multiple m-files into the local directory of remote desktop PC, and opened only one of the file in the MATLAB and then closed the MATLAB. All the m-files that were copied together are deleted together!!! I disabled "Automatically delete autosave files" option, and it didn't solve the problem.
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!