some files and subfolders disappear while using movefile()
Mostrar comentarios más antiguos
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 comentarios
fahime jam teh
el 27 de Mayo de 2021
Jan
el 27 de Mayo de 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.
Respuestas (1)
Jan
el 30 de Mayo de 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.
Categorías
Más información sobre Audio and Video Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!