Got a bit of a problem I dont know how to go about.
Basically my script takes 2 different directories, puts each file/sub
directory into an array for each, sorts the array, compares them, and
then spits out what is missing from each directory. Im really happy with
this as it is my first real ruby script and it works a charm.
Now I was wanting to add to it. Basically I want to take the size of
each file and see if they are greater than 0, and if it is 0 then output
My problem is that a directory is returned as being of size 0. Obviously
I dont care about the directory size in this case, only the file size.
How can i write my script to that it ignores the directory and only
checks if it is a file.
So at the moment my code goes
old_array = Array.new
for i in Dir[’/’]
old_array << i
The puts File.size(i) is there for a semi test, and it shows me that
directories are returned with size 0.
Thanks so much