Error using fclose "No space left on device"

76 views (last 30 days)
younes
younes on 25 Oct 2024 at 10:13
Answered: Pramil on 19 Nov 2024 at 11:42
Hello,
i'm using MATLAB 2020b and i'm trying to generate a file.dat using a Tool that i installed in Add ons but during a procssing the Data i had this error at last line on the scripte "fclose" its about the space on device but i have ~40GB free space and the file can take Max if there ara many Data 10GB :
Can you guys help me please to know why this error happen
Thank you
  1 Comment
R
R on 25 Oct 2024 at 11:00
Could you let me know which add-ons you’re using? The error seems to propagate through a range of function calls that don’t appear to be internal to MATLAB but rather related to the add-on itself.
If possible, could you also share a sample program that reproduces the issue? That would help in diagnosing the problem.
In the meantime, here are some common troubleshooting steps I can suggest, although still not sure what the root cause might be:
1.Check Temporary Directory Space: First, verify the available space in the temporary directory used by MATLAB. You can find this directory by running:
tempDir = tempname; disp(tempDir);
Make sure there’s enough space available there.
2. Clear Temporary Files: If the temporary directory is full, try clearing out unnecessary files. On UNIX systems, you can do this with:
rm -rf /tmp/*
3. Check for Disk Quotas: If you’re on a shared system, it’s worth checking if there are any disk quotas that might be limiting your available space. You may need to consult your system administrator about this.
4. Consider running a file system check to ensure there are no underlying issues. This can help identify if there are corrupted files or other problems affecting how disk space is reported.
5. Sometimes, resetting MATLAB preferences can resolve unexpected behavior. You can reset preferences by running:
restoredefaultpath;
rehash toolboxcache;
If these steps don’t resolve the issue, we may need to dig deeper into your specific environment and configurations.
Let me know how it goes.

Sign in to comment.

Answers (1)

Pramil
Pramil on 19 Nov 2024 at 11:42
Hi Younes,
I faced a similar issue in MATLAB R2020b when I was using "fwrite" after "fread".
As written in the following documentation, "fwrite" should not be used right after using "fread" and vice-versa: https://www.mathworks.com/help/matlab/ref/fopen.html#:~:text=Call-,fseek%20or%20frewind,-between%20read%20and
As suggested in the documentation itself, use either "fseek" or "frewind" between read and write operations.
Hope it helps.

Categories

Find more on Programming Utilities in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!