Directory size in Windows

This is a discussion on Directory size in Windows within the C Programming forums, part of the General Programming Boards category; I want to know how much memory that the files in a directory (and all recursive subdirectories) are using. It ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    41

    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
    Location
    Canada
    Posts
    8,046
    You could use the output of dir /v /s and process it.

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

    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: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    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
    Posts
    41
    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, 12:48 PM
  3. list size of files in directory
    By mayhem in forum C Programming
    Replies: 3
    Last Post: 02-27-2005, 10:52 PM
  4. directory size
    By warney_out in forum C Programming
    Replies: 1
    Last Post: 12-10-2004, 11:39 PM
  5. Replies: 2
    Last Post: 09-27-2003, 11:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21