Thread: Directory size in Windows

  1. #1
    Registered User
    Join Date
    Nov 2005

    Directory size in Windows

    I want to know how much memory that the files in a directory (and all recursive subdirectories) are using. It is the "size on disk" I need to know and there are windows "junctions" in the directory that needs to be handled to avoid cyclic graphs.

    How do I do this? Is there some Windows function that can help me out here?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    You could use the output of dir /v /s and process it.

    I don't know of any function way to do it.

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Mountaintop, Pa
    Take a look at Win32 API, FindFirstFile and FindNextFile. If you still have problems with the Win32 API. Post again on the Windows forum and I will answer your question.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Great, I shall look in to it in awhile.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  2. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  3. list size of files in directory
    By mayhem in forum C Programming
    Replies: 3
    Last Post: 02-27-2005, 11:52 PM
  4. directory size
    By warney_out in forum C Programming
    Replies: 1
    Last Post: 12-11-2004, 12:39 AM
  5. Replies: 2
    Last Post: 09-27-2003, 11:57 AM