www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - to get process id

reply nobody <nobody_member pathlink.com> writes:
Hello,

i try to get the process id with Regan's programm
process.d and pipestream.d under linux dmd 154 .

mport 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.
Here are the first one:

dmd pro.d lib/process.d lib/pipestream.d
pro.d(9): class lib.process.Process member readLine is not accessible
lib/process.d(335): declaration lib.process.Process.splitArgs.delims is already
defined
lib/process.d(363): undefined identifier fcntl
lib/process.d(363): undefined identifier F_SETFD
lib/process.d(363): function expected before (), not fcntl of type int
lib/process.d(364): undefined identifier fcntl
lib/process.d(364): undefined identifier F_SETFD
lib/process.d(364): function expected before (), not fcntl of type int
lib/process.d(365): undefined identifier fcntl
lib/process.d(365): undefined identifier F_SETFD
lib/process.d(365): function expected before (), not fcntl of type int

and so on.

Maybe someone have an example that run under linux.
May 23 2006
parent reply "Regan Heath" <regan netwin.co.nz> writes:
On Tue, 23 May 2006 10:31:22 +0000 (UTC), nobody  
<nobody_member 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
May 23 2006
next sibling parent nobody <nobody_member pathlink.com> writes:
Hello,

thank you.
I sit behind a firewall, so i can't download the file from the
web site.
I try it again on friday from home with pan.


In article <ops902eidb23k2f5 nrage.netwin.co.nz>, Regan Heath says...
------------xzK31oEkon9l4nRMPdWchV
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

On Tue, 23 May 2006 10:31:22 +0000 (UTC), nobody  
<nobody_member 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 ------------xzK31oEkon9l4nRMPdWchV Content-Disposition: attachment; filename=process.zip Content-Type: application/zip; name=process.zip Content-Transfer-Encoding: Base64 UEsDBBQAAAAIAINYuDS4OlJH+wwAAFEzAAAMAAAAcGlwZXN0cmVhbS5k3RprT9tK 9nOQ+A9TPnBtyCYB9n5pFlUphDYSBUTCrVZthUw8SUY4ttce87h36W/fc87M2GM7 CSmlu9JWxbFnznvOnMfY7Z3NDbbDjqL4MRHTmWTO2GX7nc7vNHzJp17IPnJPzvCZ xi54MhdpKqKQyYhlKW+yMWA32TzyxQR+fZHKRNxkkjMv9FnKg4DJmUhZGk3kvZdw IoNTQqbMj8bZnIfSk0hxEiUw88jiLImjlDPAmvGE3zyyaeKFkvvsXshZlEk24bxJ hOIkuhM+zMiZJ+ECXG+iO05CKZXCSIoxDMcx9xImQuaBRDAteIpiEBVCvonkTN3V kUNfKREX6pfoEhWgnWZxHCVShNOyai3GehmInrC5dwuMw4glPE54agBSlDuTWhoO hIT0bkQg5COLJmULVu3UYgOJtjK2ICJbXgpjW7nF+AOySxmginkcCDSml6BZH1uI 0N7c2NyARcwCzgJx04pFzGEluTfvbm4ABmjFUum3Fo/5IuoiAf4geRI6Ry4bz7xk B2YTP4sdenAJ4o4naD7nswj96D512V9sc6NhERu37tWU+e2W581s+pjyJIkSnIb/ mnNBFsYaXiDADB97Z8enffBdddNtIDz9vT8/P2VHoJDkF6Cvg2MM/mlINrvkno8z TVab+pwIhVXMnV4M+0dXl4PRP697o9Hl4P3VqD9kQY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JvJHsanEVgt/HyF6SukNNPLOZjGI4yL5NlReAvyS HvzrFTR8iTKS5V6JMMBJcQVz/kZCksilNDC+w+t7if2oLKjc6BTD95ItjEPU4Z/4 zb06kG8d7O7wCG5s5uHRLXrFTmAGSJNIoHoYGd49PEhtLYnDQmFcAM1YvDL2/tjc j/YagXbUi2CQgr+O/TdQSwECFAAUAAAACACDWLg0uDpSR/sMAABRMwAADAAAAAAA AAABACAAAAAAAAAAcGlwZXN0cmVhbS5kUEsBAhQAFAAAAAgAxFu4NA2o7M5SDgAA xjUAAAkAAAAAAAAAAQAgAAAAJQ0AAHByb2Nlc3MuZFBLBQYAAAAAAgACAHEAAACe GwAAAAA= ------------xzK31oEkon9l4nRMPdWchV--
May 23 2006
prev sibling parent reply nobody <nobody_member pathlink.com> writes:
Hello,

i have successfully compile my program, but i get no 
response.


import lib.process;
import lib.pipestream;
import std.stdio;
import std.string;

void main()
{
auto Process p = new Process("ls -la");
writefln("%s",p.readLine());
}
// dmd ping.d lib/process.d lib/pipestream.d
build ping
gcc lib/process.o ping.o lib/pipestream.o -o ping -m32 -lphobos -lpthread -lm I have comment in the line 230 in process.d extern (C) char* strerror(int); and the line 50 in pipestream.d char* strerror(int); In article <ops902eidb23k2f5 nrage.netwin.co.nz>, Regan Heath says...
------------xzK31oEkon9l4nRMPdWchV
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

On Tue, 23 May 2006 10:31:22 +0000 (UTC), nobody  
<nobody_member 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 ------------xzK31oEkon9l4nRMPdWchV Content-Disposition: attachment; filename=process.zip Content-Type: application/zip; name=process.zip Content-Transfer-Encoding: Base64 UEsDBBQAAAAIAINYuDS4OlJH+wwAAFEzAAAMAAAAcGlwZXN0cmVhbS5k3RprT9tK 9nOQ+A9TPnBtyCYB9n5pFlUphDYSBUTCrVZthUw8SUY4ttce87h36W/fc87M2GM7 CSmlu9JWxbFnznvOnMfY7Z3NDbbDjqL4MRHTmWTO2GX7nc7vNHzJp17IPnJPzvCZ xi54MhdpKqKQyYhlKW+yMWA32TzyxQR+fZHKRNxkkjMv9FnKg4DJmUhZGk3kvZdw IoNTQqbMj8bZnIfSk0hxEiUw88jiLImjlDPAmvGE3zyyaeKFkvvsXshZlEk24bxJ hOIkuhM+zMiZJ+ECXG+iO05CKZXCSIoxDMcx9xImQuaBRDAteIpiEBVCvonkTN3V kUNfKREX6pfoEhWgnWZxHCVShNOyai3GehmInrC5dwuMw4glPE54agBSlDuTWhoO hIT0bkQg5COLJmULVu3UYgOJtjK2ICJbXgpjW7nF+AOySxmginkcCDSml6BZH1uI 0N7c2NyARcwCzgJx04pFzGEluTfvbm4ABmjFUum3Fo/5IuoiAf4geRI6Ry4bz7xk B2YTP4sdenAJ4o4naD7nswj96D512V9sc6NhERu37tWU+e2W581s+pjyJIkSnIb/ mnNBFsYaXiDADB97Z8enffBdddNtIDz9vT8/P2VHoJDkF6Cvg2MM/mlINrvkno8z TVab+pwIhVXMnV4M+0dXl4PRP697o9Hl4P3VqD9kQYxQPam3RVrAH38+vzxm4VD8 yc0QGsmS7YLz2zNvzv2SeEaEfKZZSPDH+eAYWL7PJhOeNCuc1CjyszDUHKA8gnCo 8IK5USS9gAB6d54IlmGf8okcgat+Ak/zpmWlnjY3nmwHCESYPah1ihNxB0vASl4A V/DD7rJpQlfXJTAYh8JpN/cNhm5JbtFu595JLuSIUCrDww0T0VgGONRkdGm1WkaB RoYAJ4Pzs8t+75gdss7D73/fe9+tqGaccHMD2Y0DD/YdLlP/YcxjinRvWX4PECQU bn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Fu4NA2o7M5SDgAA xjUAAAkAAAAAAAAAAQAgAAAAJQ0AAHByb2Nlc3MuZFBLBQYAAAAAAgACAHEAAACe GwAAAAA= ------------xzK31oEkon9l4nRMPdWchV--
May 26 2006
parent reply "Regan Heath" <regan netwin.co.nz> writes:
On Fri, 26 May 2006 10:19:32 +0000 (UTC), nobody  
<nobody_member pathlink.com> wrote:
 Hello,

 i have successfully compile my program, but i get no
 response.


 import lib.process;
 import lib.pipestream;
 import std.stdio;
 import std.string;

 void main()
 {
 auto Process p = new Process("ls -la");
The problem is that "ls" does not exist in the current directory. You need to include the full path to the binary, eg. auto Process p = new Process("/bin/ls -la"); fork/execve doesn't work like the bash shell, it won't scan the PATH for the command it's given, it just runs exactly what you ask it to. I need to look into what I can do in the event of a failure to notify the parent thread (cos once you call fork() you get a copy, that copy calls execve and should never return, it does, indicating a failure).
 writefln("%s",p.readLine());
 }
 // dmd ping.d lib/process.d lib/pipestream.d
 build ping
gcc lib/process.o ping.o lib/pipestream.o -o ping -m32 -lphobos -lpthread -lm I have comment in the line 230 in process.d extern (C) char* strerror(int); and the line 50 in pipestream.d char* strerror(int);
Yep, those are declared in std.string and we don't need to declare them anymore. Regan
May 26 2006
parent reply nobody <nobody_member pathlink.com> writes:
Oh, what a silly mistake from me.
The "ls -la" and "ping" example run well, only the
"echo $$" print $$ instaed of the process id, but it's not so
importent, i get your example with getpid.

Thank you.


In article <ops95r7mol23k2f5 nrage.netwin.co.nz>, Regan Heath says...
On Fri, 26 May 2006 10:19:32 +0000 (UTC), nobody  
<nobody_member pathlink.com> wrote:
 Hello,

 i have successfully compile my program, but i get no
 response.


 import lib.process;
 import lib.pipestream;
 import std.stdio;
 import std.string;

 void main()
 {
 auto Process p = new Process("ls -la");
The problem is that "ls" does not exist in the current directory. You need to include the full path to the binary, eg. auto Process p = new Process("/bin/ls -la"); fork/execve doesn't work like the bash shell, it won't scan the PATH for the command it's given, it just runs exactly what you ask it to. I need to look into what I can do in the event of a failure to notify the parent thread (cos once you call fork() you get a copy, that copy calls execve and should never return, it does, indicating a failure).
 writefln("%s",p.readLine());
 }
 // dmd ping.d lib/process.d lib/pipestream.d
 build ping
gcc lib/process.o ping.o lib/pipestream.o -o ping -m32 -lphobos -lpthread -lm I have comment in the line 230 in process.d extern (C) char* strerror(int); and the line 50 in pipestream.d char* strerror(int);
Yep, those are declared in std.string and we don't need to declare them anymore. Regan
May 26 2006
parent BCS <BCS pathlink.com> writes:
nobody wrote:
 Oh, what a silly mistake from me.
 The "ls -la" and "ping" example run well, only the
 "echo $$" print $$ instaed of the process id, but it's not so
 importent, i get your example with getpid.
 
 Thank you.
 
 
as with "ls" vs. "/bin/ls" meta string explantion is done by the shell.
May 26 2006