Recent

Author Topic: Problems with TProcess and wget  (Read 9644 times)

kevinspencer33

  • New Member
  • *
  • Posts: 22
    • Adenochrome
Problems with TProcess and wget
« on: December 23, 2009, 06:26:23 pm »
I'm trying to do a kind of wget front-end, and I have a big problem with Tprocess... the program executes well programs but never appears the index.html file I try todownload for testing. I'm not sure if it's downloaded and I can't find it or it don't work at all.

Code: [Select]
procedure TForm1.BitBtn3Click(Sender: TObject);
var AStringList: TStringList;
begin
   AStringList := TStringList.Create;
   Process1.CommandLine := 'wget '+ edit1.Text;
   Process1.CurrentDirectory := '/home/isaac/';
   form1.Caption:= Process1.CommandLine;
   Process1.Options := Process1.Options + [poWaitOnExit];
   Process1.Execute;
   AStringList.Free;
end;           

I hope somebody can help me.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Problems with TProcess and wget
« Reply #1 on: December 23, 2009, 06:40:26 pm »
   Process1.CommandLine := FindDefaultExecutablePath('wget')+' '+ edit1.Text; 

kevinspencer33

  • New Member
  • *
  • Posts: 22
    • Adenochrome
Re: Problems with TProcess and wget
« Reply #2 on: December 23, 2009, 07:08:48 pm »
Thanks bu it seems that this isn't  the problem... i thing the problem is the output file, because  I can execute other programs.
I've put this line
Code: [Select]
Process1.CurrentDirectory := '/home/isaac/';just to try if its downloaded to  "/home/isaac/"... and it don't work... 

Or there is another way to do it?

Mike J

  • Jr. Member
  • **
  • Posts: 54
  • Computer Programmer/www.NewsRx.com
    • ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ ᏗᏕᎶᏆᏍᏗ (Cherokee Language Lessons)
Re: Problems with TProcess and wget
« Reply #3 on: December 23, 2009, 07:42:53 pm »
Try using an explicit -o for output when calling wget.
ᏙᎯ

kevinspencer33

  • New Member
  • *
  • Posts: 22
    • Adenochrome
Re: Problems with TProcess and wget
« Reply #4 on: December 23, 2009, 09:09:35 pm »
Tried too... no results....

And I discovered something : the  "Process1.ExitStatus" returns 2.... so I'll Google it later and try to figure out what's happening.

kevinspencer33

  • New Member
  • *
  • Posts: 22
    • Adenochrome
Re: Problems with TProcess and wget
« Reply #5 on: December 24, 2009, 03:14:20 am »
I installed a newer version of Lazarus, and Tprocess work well... but the project that i was coding don't run well... so lucky is the first part of the program that I've write.

mica

  • Full Member
  • ***
  • Posts: 196
Re: Problems with TProcess and wget
« Reply #6 on: December 24, 2009, 12:20:17 pm »
if you try to download a file/website/picture better use
curlpas or synapse
http://curlpas.sourceforge.net/curlpas/index.html
http://www.synapse.ararat.cz/doku.php
there are a lot of examples too

 

TinyPortal © 2005-2018