to get process id

Regan Heath regan at netwin.co.nz
Tue May 23 16:33:44 PDT 2006


On Tue, 23 May 2006 10:31:22 +0000 (UTC), nobody  
<nobody_member at pathlink.com> wrote:
> i try to get the process id with Regan's programm
> process.d and pipestream.d under linux dmd 154 .

Why not just call "getpid"?

import std.c.process;
import std.stdio;

void main()
{
	writefln(getpid());
}

> import lib.process;
> import std.stdio;
> import std.string;
>
> void main()
> {
> Process proc;
> proc = new Process("echo $$");
> writef(proc.readLine());
> }
> // dmd pro.d lib/process.d lib/pipestream.d
>
> I get 92 error massage.

That's because it was never compiled/tested on linux :)
I have done so now, attached is a fixed version.

Regan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process.zip
Type: application/zip
Size: 7205 bytes
Desc: not available
Url : http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20060524/93545f3f/attachment.zip 


More information about the Digitalmars-d-learn mailing list