The main goal is not specifically to get 'unchanged' files ala diff, but avoid the following:

Downloading files that are still being written to\uploaded Deleting files that were not previously downloaded (i.e.. mget *.txt, mdelete *.txt)

That's different from what your opening question said you were needing to accomplish. However, I'll stick with my original suggestion; using hashes (or HoH) would still be the better data structure. The filename would be the hash key and the sub key(s) would be the filesize and/or checksum. If the second hash has more keys, then you know that additional files were uploaded. If the filesize or checksum has changed, then you know that the file was still being written to during the prior scan.

Quote

Additionally, the majority of these files will be encrypted so reading the contents is not an option.

That's were the md5 digest would be useful. It works on binary files as well as plain text files.

Since you haven't provided any code or details about how you've coded your script, it's difficult to provide concrete code changes for your script. However, I'll assume that you're using the Net::FTP module.

Here's a short (untested) code snippet that should point you in the right direction. This generates an md5 checksum by executing a site command which appends the info to a file, which is then download and parsed to build the checksum hash.

Thanks, that works great! Need to play with the formatting a little if possible but that's not important.

So... If I wanted to compare each of the two hashes, what it the best way to accomplish this: 'where value of keys are same write results to a list? array?' since I only want the filenames (keys), is an array the best way to represent this in perl?

(I know you recommended MD5, but I want to try out each option and use each one as a learning opportunity)

Correct. Anything starting with a '.' Ultimately, I'd like to do it in the initial 'ls' string, just can't find a method that works. (Don't let the 'ls' in the string fool you, its actually doing a 'll')

I would still like to find a good solution for not displaying hidden files but I have another requirement currently.

After I download the files, I would like to do some local validation. Basically compare the hash created in previous steps against a hash created from a local 'ls -la'. I have it working but the sort order is all messed up: This is from the remote server:

It's combining/concatenating the filename and size into a single string which is then passed back to be used in the hash assignment. The first concatenated string become a key and the second concatenated string becomes its value. That process repeats until there are no more strings being returned.

There are multiple ways to build the hash correctly. Here's one approach which uses the system ls command without needlessly using awk.