Delete multiple files in the specified path.
int ocu_delete_files( LPCSTR lpcszPath, LPCSTR lpcszNamePattern = NULL, StringArray * pcsaFileSkip = NULL )
number of files deleted, or < 0 for errors
EX1
#include <ocu.h> //Notes: Deleted files can not be recovered, so be careful while using this method. void ocu_delete_files_ex1() { string strPath = GetAppPath(true) + "OriginC\\System\\"; int nNum = ocu_delete_files(strPath, "*.OPH"); //delete all files with extension name as OPH if ( nNum < 0 ) out_str("Error occurs while trying to delete files."); else printf("%d files deleted under path %s\n", nNum, strPath); }
ocu.h