Program to determine size of a directory

May 17, 2010 at 8:14am
Hello, I need to write a program to control the size of several users' directories. Is there a way to determine it from a C++ program, or should I take another approach?
May 17, 2010 at 12:24pm
What's the operating system?
May 17, 2010 at 2:20pm
What do you mean by control? Do you plan to manipulate files, place limits on their sizes, or just monitor disk usage?

Does this help?
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm
Last edited on May 17, 2010 at 2:21pm
May 17, 2010 at 2:21pm
chrisname, OS is Windows XP.

I know what I would do with a Linux box, but not in Windows, not especially when the users have named directories after themselves and are letting them grow wild.

What I mean is that I need to store the directories' size somewhere, so I can monitor which users are exceeding the limit.

Sort of like quotas, but informal. Hope I explained it better this time.
Last edited on May 17, 2010 at 2:23pm
May 17, 2010 at 3:54pm
I recommend using moorecm's link. Here it is again:
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm

-Albatross
May 17, 2010 at 3:55pm
Well, on Linux you would use stat (sys/stat.h) but I'm not sure about Windows (unless you compile with Cygwin's gcc).
Topic archived. No new replies allowed.