Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Disk Usage Question HELLLPP>.

Status
Not open for further replies.

karimj

Programmer
Dec 10, 2001
8
CA
hello...I wrote the following script...

#!/usr/bin/perl -w

$d = det_dir_name();

$size = 0;
DIR = opendir $d

While (readdir DIR) {
next if /^\.\.?$/ ;
next if -d$_;
$size == -s $_;
}

print $size
print $d

..All I need to do is where ever the script is...I need for it to tell me the diskusage of that and subsequent directories....
Currently I am getting a BAREWORD error..on the DIR = line


PLEAASE>>HELP...

THANKS
Karim

I am supposed to make it do the same as this ASP Script...

<%

'Response.ContentType = &quot;text/plain&quot;



vpath = Request(&quot;vpath&quot;)



IF vpath = &quot;&quot; then

vpath = &quot;/&quot;

END IF



realPath = server.mappath(vpath)





Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)

Set f = fs.GetFolder(realPath)



response.write f.Size & vbcrlf

response.write realPath & vbcrlf

response.write vpath & vbcrlf

%>
 
ugg..sorry..it should be determining the directory...but all I care about now..is::::...well
where ever the script resides..is where I am concerned about the directory usage..for example..

the final output I need it to be:::

1403032 d:\
so that det_dir_name is irrelevant....

Any IDEAS PLEASE>>>
 
Well one thing. Check each line for a ; at the end.
 
#!/usr/bin/perl -w

$d = det_dir_name();

$size = 0;
DIR = opendir $d;

While (readdir DIR) {
next if /^\.\.?$/ ;
next if -d$_;
$size == -s $_;
}

print $size;
print $d;

&quot;Age is nothing more than an inaccurate number bestowed upon each of us at birth as just another means for others to judge and classify us- sulfericacid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top