Hi,
I’m building a little helper which copies the contents of a local folder to another folder on our server - then compares their sizes to verify a successful copy.
The folders contain subfolders full of pretty pictures. (anywhere between 1 and 50 gb at a go)
it does it something like this…
with timeout of 0 seconds
tell application "Finder"
copy (every item of folder sourceFolder) to folder destinationFolder
end tell
end timeout
I then compares the folders like so…
set sourceSize to size of (info for sourceFolder)
set destSize to size of (info for destinationFolder)
if (sourceSize as string) ≠(destSize as string) then
--set failure message
display dialog "folder size comparison failed"
else
--set success message
display dialog "folder size comparison successful"
end if
The copy works fine - I can go through and count files etc and all is well.
HOWEVER - I never get a success message because the folder sizes are always very subtly different - by a few Kb
Whats going on?
Is there a better way to compare the contents of folders?
Any help appreciated - thanks!
B