|
-
Jan 10th, 2007, 02:44 AM
#1
Thread Starter
Addicted Member
Delete unwanted files [quickest method]
ok i have a text file which contains names of files....(e.g. joe.jpg,sarah.jpg,etc...) the text file is pretty big with like 24 entries.... the files are found in a folder pic. in this folder, there are also other files.... the folder is like with 120 files... the files are also in subfolders....
what i want is to delete all files in the folder except the files found in the text file.....
i have done it like this,
recursively scan all files in the folder/subfolders
for each file, compare it with all entries in txt file, it not found delete
it works well... it is quite quick (3/5 secs max)
however, the users of my program are claiming that it is taking an infinite amount of time when dealing with a text file with about 150 entries and a folder of 2100 files!!!!
my question is there a better way to achieve the goal i want here??? ( a quicker way)???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|