473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

directory size command

I am trying to figure out how to get the size of an entire directory. When I use:
-s DIRECTORYHANDLE
I always get zero. I am using this on Windows 2000/2003/XP with NTFS. ActivePerl 5.8.7
I searched for hours for a clue. How do I do it?
Nov 21 '06 #1
1 5685
miller
1,089 Expert 1GB
You are probably not wanting the size of the directory, but the cummulative size of the contents.

On windows, you can use the following OS specific module:
http://search.cpan.org/~arich/Win32-DirSize-1.13/Win32/DirSize/DirSize.pm

On any other system, you'll have to add up the contents yourself by opening the single directory level, or if you want a recursive size, then use File::Find.
http://search.cpan.org/~nwclark/perl-5.8.8/lib/File/Find.pm
Nov 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nate Harel | last post by:
Hi all, I need to write a small script that gives me the size of a particular directory. Is there a command or set of commands that will do this? thanks Nate
4
by: Dave Harris | last post by:
Once upon a time, a programmer could send the entire directory tree to a text file by using the command: dir c: >directory.txt Is there a way to do this in VB.NET? I need the text file to...
11
by: F. Michael Miller | last post by:
I'd like to copy the listing of a directory (& sub directories) to a text file in vb.net. I'm looking for teh equivilant of the DOS command dir /s > TargetFile.txt. Thanks!
1
by: Microsoft | last post by:
Is there a way to to retrieve Directory Property information? I am trying to develop a way to monitor total Directory size say any directory over 200 meg. I have the logic to enumerate the...
10
by: LittlePython | last post by:
I am have trouble finding a simple working example of using ADO to search Active Directory. I am hoping someone could point me to a generic working script that connects to AD and pulls up a...
4
by: RKalai | last post by:
Hi I am moving list of files from one directory to another directory.i am doing it by first moving all the files from the source directory to destination directory using filecopy command.then...
2
by: moishyyehuda | last post by:
Hi I am writing a script to upload images. How do I check the format of the file? How can I tell if the file is an image, movie, or text file? I would also like to put a limit on how much a user...
9
by: george.zhang | last post by:
Hi, Friends, I have oneconcern on my stragety on db2 backup. My db2 databse backup imdage with size 100G. On the server, it has two directories which I can use to backup: directory a with 30 G...
0
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is...
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.