Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    FLORIDA
    Posts
    12

    Grin Does anyone know what I am doing wrong?

    Here is the deal.

    I am trying to find the size of a directory on a drive.

    I am using the following command.


    Fsize = File.GetSize ("GoFile");
    Tsize= Tsize+Fsize

    The above is in a loop that is working due to it is adding the names (GoFiles) to a listbox .

    After the loop is..
    Tsize= Math.Floor(Tsize/1048576);


    I know the system gives my bytes so I am deviding by 1,048,576

    That should give me Megs.

    On a directory that has a stated size of 481 Megs I am getting a size of 53247.

    The raw Tsize I am getting is 55834574835 instead of the windows size of 505,270,272


    Can anyone knock me in the head with what I am doing wrong here..

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Sounds like the problem lies in how you're collecting/adding the file sizes. Could be that you're counting the same files more than once.

    What does the rest of the code look like?

  3. #3
    Join Date
    Nov 2003
    Location
    FLORIDA
    Posts
    12

    Thanks to worm it works fine now.

    I used the code posted by worm in another post and now all is okay. Thanks for the come back lorne .

    Thanks for the DLL worm!

    Later

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts