Win API - Delete all files except some

156 views Asked by At

Consider I want to write a program that delete all files in a given directory, except for few files which the user can define to preserve (by using a config file for example). Is there a native way to do it? The direct approach is to loop over all the files and to decide for each of them if to call DeleteFile or not. But is it the right approach?

Thanks.

0

There are 0 answers