#77034 - 2003-10-09 05:15 PM
RedirectOutput
|
Markus_Hahn
Fresh Scripter
Registered: 2002-08-07
Posts: 8
Loc: Düsseldorf, Germany
|
I want to create a logfile of a FTP operation within a script. That's the relevant code:
:ftp $log=@date+"_"+@time RedirectOutput ("c:\logs\Download_$log.txt", 1) ? "Download " $log ? Shell "ftp -i -s:c:\download.txt"
Open (1,"c:\logs\Download_$log.txt",2)
$L=ReadLine(1)
While @error=0 If InStr($L,"nicht verbunden.") GoTo repeat EndIf $L=ReadLine(1) Loop
For some reason it doesn't create the logfile. The strangest thing is that I have a login script with the same syntax which is working fine. I use KixScript Version 4.21. Any ideas ?
|
|
Top
|
|
|
|
#77036 - 2003-10-10 08:17 AM
Re: RedirectOutput
|
Markus_Hahn
Fresh Scripter
Registered: 2002-08-07
Posts: 8
Loc: Düsseldorf, Germany
|
Great. That solved the problem that it didn't want to create the logfile. Thanks. But it still doesen't write the output of the ftp operation into that file. All I can find in the file is the output from this: ? "Download " $log ?
But nothing from this: Shell "ftp -i -s:c:\download.txt"
How can I solve this issue ?
|
|
Top
|
|
|
|
#77039 - 2003-10-10 04:02 PM
Re: RedirectOutput
|
Markus_Hahn
Fresh Scripter
Registered: 2002-08-07
Posts: 8
Loc: Düsseldorf, Germany
|
This way it unfortunately doesn't work. FTP doesn't recognize the logfile path and just outputs a list of parameters (like FTP /?). Now I run this command (ftp > logfile.txt) in a seperate cmd which I start using the shell command and this works fine.
|
|
Top
|
|
|
|
#77041 - 2003-10-10 04:21 PM
Re: RedirectOutput
|
Markus_Hahn
Fresh Scripter
Registered: 2002-08-07
Posts: 8
Loc: Düsseldorf, Germany
|
No. Same error. But nevermind. You already helped me a lot. I'm now happy with what I've got. Thanks a lot.
|
|
Top
|
|
|
|
#77043 - 2003-10-11 01:56 PM
Re: RedirectOutput
|
Markus_Hahn
Fresh Scripter
Registered: 2002-08-07
Posts: 8
Loc: Düsseldorf, Germany
|
Great, you are a genius. This is how it works:
shell '%comspec% /c "ftp -i -s:c:\download.txt > c:\Download_$log.txt"'
Thanks a lot.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 756 anonymous users online.
|
|
|