Wb-FreeKill 0 Posted May 2, 2005 Im coding a program witch search a dir for files, if theres more than one of the same file, delete the others.. and i can't find a way to do this.. Right now im getting all files with data from the dir into a listview, and thought about searching trough the listview for the filename or size, and then delete if more than one of the same file exist.. Or is there a better way, a bit difficult i think any surgestions? Share this post Link to post Share on other sites
buzz44 1 Posted May 3, 2005 (edited) Each time you add a file to the ListView also add that file and its information to an array. Then each time you add a file search the array using _ArrayBinarySearch() for the file name or w/e information to search for. If it finds it then don't add the file, if it does then add it. But remember that _ArrayBinarySearch() only searches exact so searching for "hello" in "hellotest" will return null. Edited May 3, 2005 by Burrup qq Share this post Link to post Share on other sites