How do I tell rmdir to stop?
1 view (last 30 days)
Show older comments
Christian Buchgeher
on 28 Dec 2016
Commented: Christian Buchgeher
on 28 Dec 2016
Hi,
I wrote a program which saves images to a folder. Before the pictures are taken and saved I use rmdir(Foldername,'s') to remove the folder and files. Then I recreate the folder with mkdir(foldername).
Everything seems to be working while saving the pictures, however after I stop saving pictures, the pictures are deleted.
If don't use rmdir the pictures stay and are overridden in the process.
Is there any way to clear the images before I start saving neu ones?
1 Comment
Accepted Answer
Walter Roberson
on 28 Dec 2016
You could delete the files instead of the directory. For example,
delete( fullfile(Foldername, '*.jpg') )
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!