Why do I receive 'Too many files open' error messages after several hours when executing code which involves reading text files?
Show older comments
I am executing MATLAB code which involves reading several text files. I receive error messages after 10 hours. A snippet of code is provided below:
saveLo = fopen(ExportFile1,'r');
temp003=fscanf(saveLo,'%c');
% some calculations
saveLo = fopen(ExportFile2,'r');
temp003=fscanf(saveLo,'%c');
% and so on
The error messages received are provided below:
??? Error using ==> fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ==> JaganOpt1 at 386
??? C:\Program Files\MATLAB\R2007a\toolbox\matlab\graphics\hgfeval.m: Too
many files open; check that FILES = 20 in your CONFIG.SYS file.
Error in ==> scribe.legend.methods>bdowncb at 176
??? Error while evaluating axes ButtonDownFcn
??? C:\Program Files\MATLAB\R2007a\toolbox\matlab\timefun\etime.m: Too many
files open; check that FILES = 20 in your CONFIG.SYS file.
Error in ==> scribe.legend.methods>bmotion at 51
Error in ==> scribe.legend.methods>bmotioncb at 76
??? Error while evaluating figure WindowButtonMotionFcn
??? C:\Program Files\MATLAB\R2007a\toolbox\matlab\timefun\etime.m: Too many
files open; check that FILES = 20 in your CONFIG.SYS file.
Error in ==> scribe.legend.methods>bmotion at 51
Error in ==> scribe.legend.methods>bmotioncb at 76
??? Error while evaluating figure WindowButtonMotionFcn
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!