#22281 - 2002-05-29 06:22 PM
Re: Hello, help with this search script.
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
All this code seems a bit complex. It appears to me that you are only trying to find the total bytes used in a particular home directory. Although this particular code takes (a few seconds) longer, why not use something like this:
code:
$path = "h:\" $totalsize = 0 $tempfile = "%temp%\00000000.tmp" shell ("%comspec% /c dir " + $path + " /b /a-d /s > " + $tempfile) If OPEN(1,$tempfile)=0 While @error = 0 $size = GETFILESIZE(READLINE(1)) $totalsize = $totalsize + $size Loop IF Close(1)= 0 DEl $tempfile Endif Endif "Total bytes = " + $totalsize ? "Total Kbytes = " + ($totalsize/1024) ? "Total Mbytes = " + ($totalsize/1048576)
I'm sure someone else will shoot down this idea, but essentially, I'm running a bare (/b) dir command and outputting the file names to a temporary file. Then, I am reading each file name from the file and getting the filesize. These sizes are added to find the total space used by files in that particular directory tree.
Brian
|
|
Top
|
|
|
|
Hello, help with this search script.
|
^REL^
|
2002-05-28 03:53 PM
|
Re: Hello, help with this search script.
|
Sealeopard
|
2002-05-28 03:58 PM
|
Re: Hello, help with this search script.
|
^REL^
|
2002-05-28 04:13 PM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-28 05:28 PM
|
Re: Hello, help with this search script.
|
Sealeopard
|
2002-05-28 05:33 PM
|
Re: Hello, help with this search script.
|
^REL^
|
2002-05-30 12:01 AM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-30 12:13 AM
|
Re: Hello, help with this search script.
|
^REL^
|
2002-05-30 12:40 AM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-29 02:54 PM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-29 03:08 PM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-29 03:51 PM
|
Re: Hello, help with this search script.
|
^REL^
|
2002-05-29 06:02 PM
|
Re: Hello, help with this search script.
|
BrianTX
|
2002-05-29 06:22 PM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-29 06:39 PM
|
Re: Hello, help with this search script.
|
BrianTX
|
2002-05-29 08:29 PM
|
Re: Hello, help with this search script.
|
MCA
|
2002-05-29 08:39 PM
|
Re: Hello, help with this search script.
|
DrillSergeant
|
2002-06-03 11:04 AM
|
Re: Hello, help with this search script.
|
MCA
|
2002-06-05 05:10 PM
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|