Results 1 to 8 of 8

Thread: Getting the size of a folder

  1. #1
    Guest

    Post

    How do i get the total size of a folder, including everything contained in it?

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    New York City
    Posts
    73
    Call the following routine where filespec is the name
    of your folder

    Sub ShowFolderSize(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(filespec)
    s = UCase(f.Name) & " uses " & f.size & " bytes."
    MsgBox s, 0, "Folder Size Info"
    End Sub


    Regards

    Rich

  3. #3
    Guest
    Did you even look at what forum your in?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Talking Hehehehehehehe.

    Biggest laugh I've had all day!
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Parksie, if that wasn't so sad it would be funny
    Harry.

    "From one thing, know ten thousand things."

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Hmmm...but I have been doing my stats 2 project all day, so

    All I could find was opendir() and readdir(), but VC++ doesn't seem to have headers for them
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Guest
    Parksie, im using Turbo C++, and those are in dirent.h, how would i use them? Oh, and just because it might help, i have a function already set up to return the size in bytes of a file.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    No idea. I have no documentation and no way of testing. So here's something from microsoft (of all people!):
    http://msdn.microsoft.com/library/of...ge/a_modfp.htm
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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