Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Files created by Matlab cannot be deleted [duplicate]

Tags:

file-io

matlab

Possible Duplicate:
How do you handle resources in MATLAB in an exception safe manner? (like “try … finally”)
How can I close files that are left open after an error?

I create some files and directories via fopen and mkdir, and I close any open streams with the appropriate fclose command when I finish writing to the files. Nevertheless, when I abort a computation with Ctrl+C these directories/files remain in memory somehow and I am unable to delete them. Not even subsequent close all calls can free them, I have to exit Matlab to free these files. Any idea how I can counter this behaviour (other than 'stop using abort')?

System is: Win7 64bit, Matlab R2011b.

like image 918
István Zachar Avatar asked Sep 10 '25 23:09

István Zachar


1 Answers

Simple solution: fclose('all')

like image 166
CitizenInsane Avatar answered Sep 13 '25 15:09

CitizenInsane