some files and subfolders disappear while using movefile()
이전 댓글 표시
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
fahime jam teh
2021년 5월 27일
Jan
2021년 5월 27일
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.
답변 (1개)
Jan
2021년 5월 30일
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.
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!