Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-06

How to get any or all service's list and info

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

Hello,
I need get any or all service's list and info's. And its work on linux, win & os x. Why I need, I need "firebird" service is working and if its work, where is path detail.
Thank you

Reply by email

FreeMan
to FreeMan

03-06-2014 20:28 tarihinde, FreeMan yazd?:

Show quoted text 5 lines
Hello, I need get any or all service's list and info's. And its work on linux, win & os x. Why I need, I need "firebird" service is working and if its work, where is path detail. Thank you

Kubuntu 14.04 x64: fpc & lazarus svn
This is my solution, for linux. I added "="symbol for can use tStrings.IndexOfName
for osx comm,args Can not add symbol so need some cod for search, and I'm not install lazarus on osx so I can not test code, windows too, I hope some one test that and share

...
uses Process;
{$R *.lfm}
procedure TForm1.Button1Click(Sender: TObject);
var
   AProcess: TProcess;
   I:integer;
begin
   Memo1.Lines.Clear;
     AProcess := TProcess.Create(nil);
     AProcess.CommandLine := 'ps axeo "%c=%a";
     AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
     AProcess.Execute;
     Memo1.Lines.LoadFromStream(AProcess.Output);
     AProcess.Free;
     I:=Memo1.Lines.IndexOfName('fbserver       ');
     if I >=0then self.Caption := Memo1.Lines.ValueFromIndex[I]
     else self.Caption := 'not found';
end;

Reply by email