some files and subfolders disappear while using movefile()
Afficher commentaires plus anciens
Hi,
By mistake I use the movefile to move my current directory to a new one. by using movefile('.','newfolder'); In this case, some files and subfolders are moved but some are disappeared. I don't know the reason but the remain filenames strat with 'p' to 'z' and the disappeared filenames strat with 'a' to 'p'.
would you please help me that where and how I can find them?
I search for deleted files with some recovery softwares, but I just can recover some of them from the newfolder.
3 commentaires
fahime jam teh
le 27 Mai 2021
Jan
le 27 Mai 2021
Actually it should not be possible to move the current folder, because it is open in an application. I can try it in Octave only, where trying to move "." stops with an error message.
If you do not have a backup and tools like Recuva cannot find your files, they are gone.
Réponses (1)
Jan
le 30 Mai 2021
I tried it on a Windows PC with Matlab R2018b now:
cd(tempdir);
mkdir('MyTest')
cd('MyTest');
for k = 'a':'z'
imwrite(rand(10, 10, 3), [k, '.png']);
end
movefile('.', 'MyTest_copied')
% Or: movefile('.', '..\MyTest_copied')
It does work and no files vanish. In the last case the empty folder MyTest does still exist, because the OS cannot delete itas long as it is the current folder in Matlab.
This means, that I do not have an explanation why some files are missing on your computer.
Catégories
En savoir plus sur Audio and Video Data dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!