"File might be corrupt" error even files are not corrupt

29 views (last 30 days)
Hi All,
I have a couple of files with the 'File might be corrupt." error message when they are loaded.
They are not corrupt because they can be loaded if the file location is changed (see below).
The version of MATLAB is 9.8.0.1417392 (R2020a) Update 4
The enviromnet is a bit complicated.
MATLAB is running on the Windows10 virtual desktop.
I am accessing with VMWare Horizon Client from the Windows10 PC.
A local folder of my PC is shared with the virtual desktop.
That folder is used for OneDrive (but the files exist on the local drive).
These "corrupt" files are created under this share folder.
The file size is ~50 KB.
However, once they are created, they are not able to be loaded.
Once the files are moved to the Desktop of the virtual Windows10,
they can be loaded.
This issue may be due to this complicated environment rather than MATLAB itself,
but if someone knows how to fix it, please let me know.
Thank you in advance for your help.
Regards,
Kosuke
Added on 12/4/2020
Thank you for the comments from the community members.
It is nice to have such a wonderful community to help each other.
Let me add a couple of things.
1. Even there is a file with the 'File might be corrupt." error in the shared folder (that is shared between Virtual Desktop and local PC, and also local PC and OneDrive), other files in that folder can be loaded without problems.
2. If the same variables included in the original file are saved as same or different name, the error message persists.
3. Currently, the files showing this error message are related to xlsread, i.e, [num, txt, raw] = xlsread(filename), then the three variables are saved in a MAT file directly or they are comined in a structure and saved.
  4 Comments
Walter Roberson
Walter Roberson on 3 Dec 2020
MATLAB especially does not always play nice with OneDrive. There have been problems in the past with setting up local caching in OneDrive -- something that improves performance a fair bit, but there was some kind of timing glitch .
It is not uncommon for there to be difficulties related to time synchronization between systems with network drives. These kinds of problems affect nearly all network drive systems (except Kerobos, which has a built-in time synchronization), but the posts I see about these kinds of time problems feedback loops seem to all come from Windows systems these days (which could be because there are a lot more Windows systems.)
Kosuke
Kosuke on 3 Dec 2020
Thank you for the detailed information, Walter.
Maybe I should try to change the location of the share folder from OneDrive to another folder which is not involved in OneDrive.
As I wrote in the reply to Rik,
I can use MATLAB only on the virtual desktop.
Sometimes the virtual desktop lose the connection with the local drive on my PC,
and MATLAB lose the connection to files.
Then I have to restart VMWare Horizon Client to re-recognized the local drive.
Well, it is sometimes stressful but I should think I am lucky to have an access to MATLAB.
Thank you again,
Kosuke

Sign in to comment.

Answers (1)

Kandarp Khandwala
Kandarp Khandwala on 4 Dec 2020
Hi Kosuke, you could try marking the file(s) or folder for offline use as follows, which might avoid the issue:
  1. Right-click a file or folder.
  2. Select Always keep on this device.
  1 Comment
Kosuke
Kosuke on 4 Dec 2020
Hi Kandarp,
Thank you for letting me know the information of OneDrive.
Currently, the setting is I believe "this Always keep on this device", i.e., files are saved in the local device.
Thank you again, and please have a nice weekend,
Kosuke

Sign in to comment.

Categories

Find more on File Operations in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!