Code: Select all
Global lngProgram.l
Global strErrLine.s
Global strEBuffer.s
lngProgram = RunProgram("wget", "--load-cookies=" + Chr(34) + "/home/martin/Cookie Folder/cookies.txt" + Chr(34) + " " + Chr(34) + "http://www.google.com" + Chr(34), "", #PB_Program_Error | #PB_Program_Open)
While ProgramRunning(lngProgram)
Repeat
strErrLine = ReadProgramError(lngProgram)
If strErrLine
strEBuffer + #CRLF$ + strErrLine
EndIf
Until strErrLine = ""
Delay(20)
Wend
Repeat
strErrLine = ReadProgramError(lngProgram)
If strErrLine
strEBuffer + #CRLF$ + strErrLine
EndIf
Until strErrLine = ""
Debug ProgramExitCode(lngProgram)
CloseProgram(lngProgram)
Debug strEBuffer
I get the following debug output:
Code: Select all
0
Cannot open cookies file `"/home/martin/Cookie': No such file or directory
--14:49:53-- http://folder/cookies.txt%22
=> `cookies.txt"'
Resolving folder... failed: Name or service not known.
--14:49:53-- http://www.google.com/
=> `index.html.1'
Resolving www.google.com... 209.85.129.104, 209.85.129.147, 209.85.129.99
Connecting to www.google.com|209.85.129.104|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.de/ [following]
--14:49:53-- http://www.google.de/
=> `index.html.1'
Resolving www.google.de... 209.85.129.104, 209.85.129.99, 209.85.129.147
Reusing existing connection to www.google.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
0K ..... 60.25 KB/s
"/home/martin/Cookie
as cooky path.
Removing the space from the path does not help,
as it is also treating the quotation mark as part of the path.
It only works with a path with no spaces and leaving out the quotation marks.
Stangely it seems to have not problems with the quotation marks around the url!
I tried escapeing spaces or quotation marks with backslashes, but that does not help.
I can run the same string from bash and it works without a problem.
I'm using GNU Wget 1.10.2.
Can anyone help me to find out what's wrong or how to get that to work?

