CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    Hamburg / Germany
    Posts
    280

    file and directory-sizes on disc

    Dear Gurus,
    this is an edit of another posting that I recycled ;o)

    Ok, my first question from the old posting is answered by something I found on the web.

    and I can ask my second question now much more clearly, because now I know that the physical filesize and the size on disk are NOT equal because of something called clustering.

    Ok, I nearly figured out how this works, but I don't know if I am right, so I ask you:

    I need to dertermine the physical filesize and the space it occupies on disk.

    the first one is easy, but how to get the size on disk ? As I understood, one needs to do the following:

    int sizeondisk;
    int m = filesize % clustersize;

    if (m > 0)
    {
    sizeondisk = filesize - m;
    sizeondisk += clustersize;
    }
    else
    {
    sizeondisk = filesize;
    }

    is this right ? if not, please tell me why.

    Another question is how to determine clustersize. I did't find a way to get this value.

    Ok, thanks in advance

    Juergen
    Last edited by AlionSolutions; February 18th, 2003 at 08:45 AM.

  2. #2
    Join Date
    Aug 2002
    Location
    Hamburg / Germany
    Posts
    280

    Cool problem solved

    ok, this is DONE !!!
    Soetimes I should have a look in VC++-programmers-domain

    for those also interested:

    http://www.codeguru.com/system/clustersize.shtml

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured