Wb-FreeKill Posted May 2, 2005 Share 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? Link to comment Share on other sites More sharing options...
buzz44 Posted May 3, 2005 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now