fork download
  1. #include <iostream>
  2.  
  3. void callbackfn(std::string path, std::string filename)
  4. {
  5. std::cout << "delete " << path << "\\" << filename << "\n";
  6. }
  7.  
  8. void BatchDelete(std::string path, std::string file, void (*fn)(std::string, std::string))
  9. {
  10. // pretend these are songs we found in playlist.mpl
  11. fn(path, "Alanis\\*.*");
  12. fn(path, "Mix Tape\\ReallySadSong.mp3");
  13. }
  14.  
  15. int main()
  16. {
  17. BatchDelete("C:\\Music\\", "playlist.mpl", callbackfn);
  18. }
  19.  
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
delete C:\Music\\Alanis\*.*
delete C:\Music\\Mix Tape\ReallySadSong.mp3