in reply to Re: Handling Hash Comparison in thread Handling Hash Comparison
no, I posted my code in the readmore tags, in my original post. What happened is that initially I was only doing this in the dir that was specified at the command line, but later decided to add the ability to recurse dirs. my original code concatenated the dir onto the $key so that it copied appropriately, but when I added recursion, I could not longer copy the files in the same way, problem is I have no idea how best to proceed.
Take a look at the rest of my code? Thanks.
update: apologies, if that came off inappropriately, I was really just meaning to ask to have another look. Thanks for the pointer, I will take a look at File::Find:dir. One question, though. Does the logic make sense to get the filename for the second dir? I am probably just missing something obvious. I appreciate the help. Thanks again.
Re^3: Handling Hash Comparison
by Errto (Vicar) on Jul 23, 2005 at 04:16 UTC
|
Ok. I posted an update above - basically you can use $File::Find::dir instead of getcwd so that the relative path instead of the absolute path becomes the key. But now I'm unclear - I understand that if two files in corresponding relative paths have matching MD5 sums you want to do something, but I don't understand what that is. Right now what would happen is that you copy the file onto itself. | [reply] |
|
exactly, and that is my issue, that I am not sure how I need to change the code to get the appropriate arguments to 'cp'.
| [reply] |
|
So, I'm still not clear...what do you want it to do? In the OP you only said you wanted to compare MD5 sums of corresponding files. I don't see how copying fits into it.
| [reply] |
|
|
|