Jump to content

Recommended Posts

Posted

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?

Posted (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 by Burrup

qq

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...