Hi, I was wondering how you might go about deleting all of one certain file type in a folder. For instance, say asked the user if he wanted to erase all text entries(.txt) to clear up his folder, and it would do it all at once.


Thanks! :)

Get a list of the files by calling one of the os-specific api functions. MS-Wndows its FindFirstFile() and FindNextFile(). *nix its opendir() and readdir().

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.