Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get Folder size throuogh program

How to get Folder size throuogh program

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++tutorial
11 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A ashishbhatt 0

    Hi All, I am using MFC Application , in that I want to get the specific folder size.So How can I do that?? i have the full path of the folder. Thanks in advance.

    Ashish Bhatt

    C Offline
    C Offline
    chandu004
    wrote on last edited by
    #2

    iam not sure if there is any function to find the whole folder size at a time. but using some functions, like findfirst and findnext, you can write a recursive function, which traverses the folder and its sub folders, sum the sizes of the files and return you the folder size. lets see if any master suggests any thing. gud luck. -------------------------------------------

    Suggestion to the members: prefix your main thread subject with [SOLVED] if it is solved. chandu.

    A 1 Reply Last reply
    0
    • A ashishbhatt 0

      Hi All, I am using MFC Application , in that I want to get the specific folder size.So How can I do that?? i have the full path of the folder. Thanks in advance.

      Ashish Bhatt

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #3

      See Xfoldersize - A class to determine folder size [^] (none MFC class) and Display content size for a folder in Explorer using shell extensions[^] and folder size Information in the Windows Explorer Details view[^].

      T 1 Reply Last reply
      0
      • C chandu004

        iam not sure if there is any function to find the whole folder size at a time. but using some functions, like findfirst and findnext, you can write a recursive function, which traverses the folder and its sub folders, sum the sizes of the files and return you the folder size. lets see if any master suggests any thing. gud luck. -------------------------------------------

        Suggestion to the members: prefix your main thread subject with [SOLVED] if it is solved. chandu.

        A Offline
        A Offline
        ashishbhatt 0
        wrote on last edited by
        #4

        No I don't want to call function recursivly. I don't want to go on that way. Is there no any function which gives me the direct size of the folder just like file. Thanks..

        Ashish Bhatt

        realJSOPR T 2 Replies Last reply
        0
        • A ashishbhatt 0

          Hi All, I am using MFC Application , in that I want to get the specific folder size.So How can I do that?? i have the full path of the folder. Thanks in advance.

          Ashish Bhatt

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #5

          ashishbhatt wrote:

          ...I want to get the specific folder size.So How can I do that??

          You want the size of the folder itself, or the size of all files in the folder?


          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          realJSOPR 1 Reply Last reply
          0
          • A ashishbhatt 0

            No I don't want to call function recursivly. I don't want to go on that way. Is there no any function which gives me the direct size of the folder just like file. Thanks..

            Ashish Bhatt

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #6

            ashishbhatt wrote:

            No I don't want to call function recursivly.

            Then you're doomed to fail.

            ashishbhatt wrote:

            Is there no any function which gives me the direct size of the folder just like file.

            He already told you no.

            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            1 Reply Last reply
            0
            • D David Crow

              ashishbhatt wrote:

              ...I want to get the specific folder size.So How can I do that??

              You want the size of the folder itself, or the size of all files in the folder?


              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #7

              DavidCrow wrote:

              You want the size of the folder itself, or the size of all files in the folder?

              He probably doesn't know. He should consider changing his vocation to something a bit less mentally challenging, like working at a convenience store, or driving a taxi.

              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

              T 1 Reply Last reply
              0
              • realJSOPR realJSOP

                DavidCrow wrote:

                You want the size of the folder itself, or the size of all files in the folder?

                He probably doesn't know. He should consider changing his vocation to something a bit less mentally challenging, like working at a convenience store, or driving a taxi.

                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #8

                John Simmons / outlaw programmer wrote:

                like working at a convenience store, or driving a taxi.

                what about cleaning road!:->

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                Never mind - my own stupidity is the source of every "problem" - Mixture

                cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                1 Reply Last reply
                0
                • H Hamid Taebi

                  See Xfoldersize - A class to determine folder size [^] (none MFC class) and Display content size for a folder in Explorer using shell extensions[^] and folder size Information in the Windows Explorer Details view[^].

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #9

                  Hamid. wrote:

                  See Xfoldersize - A class to determine folder size [^]

                  I Like this class very much!

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                  Never mind - my own stupidity is the source of every "problem" - Mixture

                  cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                  H 1 Reply Last reply
                  0
                  • A ashishbhatt 0

                    No I don't want to call function recursivly. I don't want to go on that way. Is there no any function which gives me the direct size of the folder just like file. Thanks..

                    Ashish Bhatt

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #10

                    ashishbhatt wrote:

                    No I don't want to call function recursivly. I don't want to go on that way. Is there no any function which gives me the direct size of the folder just like file.

                    Windows do that itself also. try seeing property of Windows folder of your computer , you could see change in size rapidly!

                    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                    Never mind - my own stupidity is the source of every "problem" - Mixture

                    cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                    1 Reply Last reply
                    0
                    • T ThatsAlok

                      Hamid. wrote:

                      See Xfoldersize - A class to determine folder size [^]

                      I Like this class very much!

                      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                      Never mind - my own stupidity is the source of every "problem" - Mixture

                      cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #11

                      And you have an article that I like it.;)

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups