How do I tell rmdir to stop?

1 view (last 30 days)
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
per isakson
per isakson on 28 Dec 2016
In plain English, what do you want to achieve?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Dec 2016
You could delete the files instead of the directory. For example,
delete( fullfile(Foldername, '*.jpg') )

More Answers (0)

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!