Page 1 of 1

file sizes

Posted: Wed Mar 04, 2009 1:53 am
by sen5243
Hi Oleg
 
I’ve got a question.
I have three folders, they are called 01,02 and 03.
All three folders contain the same file called: test.xml.
But their file sizes are different.
Now I need the middle sized file, in one of these folders.
And then move the file to a different location.
Is it possible to help me?
 
Thanks Richard

file sizes

Posted: Wed Mar 04, 2009 2:10 am
by Oleg
There is {FileSize()} system variable
You may use it:
{FileSize(c:\01\test.xml)}
{FileSize(c:\02\test.xml)}
{FileSize(c:\03\test.xml)}

In order to determine the miidle size use the following algorithm:
Suppose we have 3 values: size1, size2, and size3

Code: Select all

if size1 > size2 then
   if size1 < size3 then
      middle = size1
   else
      if size2 > size3 then 
         middle = size2
      else
         middle = size3
      end if
   end if
else
   if size1 > size3 then
      middle = size1
   else
      if size2 < size3 then 
         middle = size2
      else
         middle = size3
      end if
   end if
end if

file sizes

Posted: Wed Mar 04, 2009 4:16 am
by sen5243
Hi oleg
 
It is working flawless !!
Thanks a lot
 
richard