#22274 - 2002-05-30 12:01 AM
Re: Hello, help with this search script.
|
^REL^
Fresh Scripter
Registered: 2001-06-11
Posts: 30
Loc: Netherlands
|
Hello Jens,
I've read the code carefully. And I do not understand the way kix read files. The rewrite of your code is not working.
As I studied this:
code:
SHELL '%COMSPEC% /C dir '+$Path+' /s /a-d /-c | find "'+$String+'" >'+$TempFile
OPEN(1, $TempFile) $Line = READLINE(1) WHILE $Line<>'' AND @ERROR=0 $PrevLine=$Line $Line = READLINE(1) LOOP $retcode = CLOSE(1) DEL $TempFile
As i tried to understand what this code does, here is my interpertation:
First line is appending "DIR /S" directory output to a tempfile. Next line OPEN(1, $TempFile) Is opening the tempfile under handle# 1. $Line = READLINE(1) I guess the READLINE function will read the tempfile's first line and put this in VAR $line. WHILE $Line<>'' AND @ERROR=0 As long as the $line VAR is not empty and no error occurs. $PrevLine=$Line Put VAR $line in $prefline.
My question is: Why to use the first READLINE before the loop, and Why using a second variable $PrefLine?
Oke, after the loop has finisched, I guess not the $Line variable but the $PrefLine variable would contain the same output as the TempFile did, right?
And then your array code, here is where the script errors. I don't know why maybe the $Line variable is empty or teh syntax is wrong.
code:
$array=split($Line,' ') $files=$array[0] $bytes=val($array[3]) $megabytes=$bytes/1048576 ? $files ? $bytes ? $megabytes
Tell me if iam wrong, just and please help me with this.
-rel
_________________________
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.
|
|
|