Warning: Temporary folder could not be deleted

Every time I save the app source, I get a new directory in the current directory with a name like appDesignerTempData_964888535199
and an error message:
Warning: Temporary folder C:\Users\lent\Dropbox\MATLABappdesigner\BasicSliderPlot\appDesignerTempData_964888535199 could not be deleted.
Please delete manually.
(Bold face is the current folder)
They accumulate.
I tried running as administrator and it doesn't help.
How do I get this temporary file creation to stop?

9 件のコメント

Lisa R. Thompson
Lisa R. Thompson 2020 年 7 月 31 日
Also having this same problem (on both 2020a and 2020b pre-release versions). Also using Dropbox, but could just be coincidence.
XINWEN YAO
XINWEN YAO 2020 年 9 月 14 日
編集済み: XINWEN YAO 2020 年 9 月 14 日
same here. Running matlab app in dropbox in a windows PC.
And it seems not a problem in Mac + dropbox.
Tommaso Ferrario
Tommaso Ferrario 2020 年 12 月 9 日
same problem
Colin Field
Colin Field 2021 年 2 月 10 日
Same problem, also running Dropbox.
Adam Danz
Adam Danz 2021 年 2 月 10 日
Try removing the directory from the Matlab path using rmpath(__)
Has anyone tried to manually delete the folder as the error message suggests?
As a last resort, if the app is still open and unsaved, backup all of the code into a saved text file (select-all, copy, paste) then close down matlab. When matlab reopens, does the problem persist? If so, try restoredefaultpath.
Lisa R. Thompson
Lisa R. Thompson 2021 年 2 月 28 日
Thank you for the advice. On my computer, the problem seems to have resolved recently without user intervention. It had been filling up the folder containing the app with temp files upon every app save. Currently running 2020b release version. Had previously tried restoring the default path in the 2020a and 2020b pre-release versions without any success in changing of temp file problem.
Laurenz Muessig
Laurenz Muessig 2021 年 3 月 1 日
I have the same issue (2020a). I can delete the folders manually, but obviously that's a bit annoying.
Craig Lent
Craig Lent 2021 年 4 月 2 日
Still a problem in 2021a
Dmitry Kaplan
Dmitry Kaplan 2022 年 7 月 23 日
編集済み: Dmitry Kaplan 2022 年 7 月 23 日
Still a problem in R2022a. I believe also that it's the interaction between Dropbox and Matlab, but not simply due to a cloud backup -- more like preparing for a cloud backup... I think... (because I don't see any backup activity on those). See my suggestion below for a change to the serialization code that moves the backup directories to the temp directory, where it truly belongs. I don't feel qualified suggesting it as an answer since the files involved are in a write-only directory and the whole 'temp' vs 'tmp', win/pc/apple/whatever associated issues.

サインインしてコメントする。

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 4 月 2 日

0 投票

I suspect this has to do with you saving to a Dropbox folder. My guess is that Dropbox is doing something with the file when MATLAB tries to delete it (likely actively syncing it to the cloud).
You might be able to confirm this by saving your source to a folder that is not in your Dropbox folder and see if you still get the same warning.

1 件のコメント

Dmitry Kaplan
Dmitry Kaplan 2022 年 7 月 23 日
編集済み: Dmitry Kaplan 2022 年 7 月 23 日
I think it is the interaction between matlab and dropbox that's the problem. I suspect this will be a problem with many continuous backup systems. Matlab can easily address this by storing the appDesignerTempData where it belongs -- in a "temp" directory, not in pwd(). Or let us pick the location.
Another option may be in fileWriter.m in appdesigner\+appdesigner\+internal\+serialization
% create a random folder name so no existing folders are affected
randomNumber = floor(rand*1e12);
testDirPrefix = 'appDesignerTempData_';
% START NEW: may want to consider something like
if ~isempty(getenv('Temp'))
testDirPrefix = fullfile(getenv('Temp'),testDirPrefix);
end
% END NEW
testDir = [testDirPrefix, num2str(randomNumber)];

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

製品

質問済み:

2020 年 7 月 7 日

編集済み:

2022 年 7 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by