#22269 - 2002-05-28 03:53 PM
Hello, help with this search script.
|
^REL^
Fresh Scripter
Registered: 2001-06-11
Posts: 30
Loc: Netherlands
|
Hello,
Iam busy personalizing a bit of code that I grabbed from this board. After lots of debugging. I can't get it to work. This is for a kind of quota.
code:
$Path = "H:\" $TempFile = "C:\00003.tmp"
$Lokaal = GETFILEVERSION("%WINDIR%\Explorer.exe", "Language") ? $Locale IF $Lokaal = "0413Dutch" $String = "bestand(en)" ELSE $String = "File(s)" ENDIF
;=== Vang de DIR info op, filter alle regels weg behalve de regels met $String (directory output) SHELL '%COMSPEC% /C dir $Path /s /a-d /-c | find "$String" >$TempFile'
$ = OPEN(1, $TempFile) $Line = READLINE(1) WHILE $Line <> "" $PrevLine = $Line $Line = READLINE(1) LOOP $ = CLOSE(1) DEL $TempFile
$Files = VAL(LTRIM(SUBSTR($PrevLine, 1, INSTR($PrevLine, "f") - 2))) $Bytes = LTRIM(SUBSTR($PrevLine, INSTR($PrevLine, ")") + 1, LEN($PrevLine) - INSTR($PrevLine, ")") - (LEN($PrevLine) - INSTR($PrevLine, "b") + 2))) WHILE INSTR($Bytes, " ") <> 0 $Bytes = SUBSTR($Bytes, 1, INSTR($bytes, " ") -1) + SUBSTR($Bytes, INSTR($Bytes, " ") + 1, LEN($Bytes) - INSTR($Bytes, " ") + 1) LOOP
;=== Converteer het resultaat naar een integer variable. $Bytes = VAL($Bytes) ? $Bytes $HomeDir_KBytes=$bytes+512)/1024 ? $HomeDir_KBytes
The problem is that var $Byte returns 0, while there is a long list off output. And also how to convert $Bytes to Mb's (rounded). Here is a bit off the $TempFile:
[LIST]
11 bestand(en) 21614165 bytes 8 bestand(en) 5802031 bytes 21 bestand(en) 174794 bytes 12 bestand(en) 20258 bytes 6 bestand(en) 550450 bytes 1 bestand(en) 141712 bytes 37 bestand(en) 9471557 bytes 2 bestand(en) 230275 bytes 5 bestand(en) 380928 bytes 2 bestand(en) 122880 bytes 6 bestand(en) 360009 bytes 19 bestand(en) 6200890 bytes 13 bestand(en) 13861188 bytes 12 bestand(en) 13936784 bytes 3 bestand(en) 93184 bytes 2 bestand(en) 53517 bytes 10 bestand(en) 4822 bytes 10 bestand(en) 4822 bytes 1 bestand(en) 1155801 bytes 1 bestand(en) 500 bytes 10 bestand(en) 25121 bytes 8 bestand(en) 14484 bytes 94 bestand(en) 3837701 bytes 44 bestand(en) 61698 bytes 82 bestand(en) 63496 bytes 5 bestand(en) 22852 bytes 22 bestand(en) 99250 bytes 2 bestand(en) 3436 bytes 6 bestand(en) 786463 bytes 1 bestand(en) 299008 bytes 15 bestand(en) 11599954 bytes 1 bestand(en) 16896 bytes 1 bestand(en) 308304 bytes 1 bestand(en) 9975 bytes 7610 bestand(en) 518343550 bytes
[/LIST]
_________________________
This is Unix Country. On a quiet night you can hear NT reboot.
|
|
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.
|
|
|