|
"Scott " <scott.mohnkern@noaa.gov> wrote in message <h1t8sn$ov9$1@fred.mathworks.com>...
> "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <h1p2ud$2sp$1@fred.mathworks.com>...
> > Dear Scott!
> >
> > > fp = fopen('test.txt','w');
> > > for i = 1:50
> > > fprintf(fp,'%4d hi, i am from hdsc\n',i);
> > > end;
> > > fclose(fp);
> > >
> > > This works fine, and creates the file expected. However, when I do the following;
> > > ...
> > > for i = 1:500
> > > ...
> > > ??? Error using ==> fclose
> > > Invalid file identifier. Use fopen to generate a valid file identifier.
> >
> > The file identifier can get invalid during writing, if the disk is full or the quota is reached. Nevertheless, the error appears at closing and not during writing. This would mean, that the problem occurs, when the last line is written.
> > -- This is unlikely!
> > In addition, you would have more problem, if the disk is completely full.
> >
> > Another source for this problem might be a TIMER function, which changes the variable "fp" after a certain time, which is by accident exactly the time after the last line has been written. Nevertheless, you would need a DRAWNOW anywhere in the code, to allow the TIMERFCN to operate.
> > -- Really unlikely!
> >
> > So I assume, there is a completely other problem in some code, you do not show here.
> >
> > Good luck, Jan
>
> Actually, what I posted was the entirety of the code. The disk isn't full, and there aren't quotas. (It is writing to an NFS mount, but that should be no problem).
Not sure if replying on old posts is of any use: I also had this problem with NFS. On the client, there were no quota's. However, on the NFS server, there were, and that caused the problem.
|