On Nov 14, Sebastien Alborini quoth:

> > This is NOT 100% pure java.  (there's a 4 line C program--ick!)
> > 
> > I have done some research, and it doesn't appear that there is anyway
> > to get the current process id from within java any other way.  If
> > anybody knows otherwise, let me know -- it will make this a lot
> > simpler.
> 
> I don't know in java, but in bash you can get the pid of the process you
> just launched in the background with "echo $!"

I too have done a lot of research on this topic and can confirm that there
is, in fact, no way to get the process ID in a 100% java manner. After
much searching I began to realized that this makes sense as the notion of
a PID is outside the scope of the JVM and having that information wouldn't
allow you to do anything constructive without other system-dependencies.

C=)

--------------------------------------------------------------------------
If you want to build a ship, don't drum up people together to collect wood
 and don't assign them tasks and work, but rather teach them to long for
     the endless immensity of the sea. -- Antoine de Saint Exupery
--------------------------------------------------------------------------
Caskey <caskey*technocage.com>       ///                   TechnoCage Inc.
--------------------------------------------------------------------------
  It's not an optical illusion, it just looks like one.  -- Phil White



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to