This is a bit old now, but I just found that PSTAT.EXE does not appear to
be included with basic NT(?). I have one version from DevStudios, and another from Watcom\binnt -- C/C++ compiler. Still haven't verified this program is included with Win95/98; but now it appears it probably is not, though you should be able to install it. ---------------------- Forwarded by Andrew Wright on 04/01/99 08:17 AM --------------------------- [hidden email] on 03/12/99 09:17:16 AM To: [hidden email] cc: (bcc: Andrew Wright) Subject: Re: NT/4 or OS/2 system variable value in NetRexx or Java? Another way might be viable, as long as your program can access the system it is running on (not sure if that part was answered in the previous notes). Assuming it can, your program can first run PSTAT (same command on NT or OS/2) and verify that it is the only instance of itself in the list, if not, exit. I pipe the data to a file and access the file (eg. PSTAT > PSTAT.LOG). ---------------------- Forwarded by Andrew Wright on 03/12/99 09:16 AM --------------------------- [hidden email] (Jerry McBride) on 03/11/99 03:34:41 PM To: "Simon Husin/ASG/US/AON" <[hidden email]> cc: [hidden email] (bcc: Andrew Wright) Subject: Re: NT/4 or OS/2 system variable value in NetRexx or Java? >Hi all, > >For our project we need to prevent another session of the same Java-based >application from running, ever. Since the application needs be run on only >NT and OS/2, what I have in mind is to use a system variable that needs be >tested and set if it is not yet set by the application. > >Related to the above I have three questions: > >1) How can I get the value and/or set the value of such a variable in >NetRexx or Java? > As far as I know, and I've looked pretty extensively, Java has no IPC layer to speak of. The current JVM model assumes it own's the machine it's running on. >2) Is the system variable system-wide or only for one session? > Per session. >3) Is there a better way to accomplish the above? > Yes! You can create a file in a pre-determined drirectory and use that as a marker that a process is already running. You can use the socket interface and have your application look for other copies of itself... You can use a wonderful Java implementation of PIPES that may be able to do what you wish. You can find Pipes at Hobbes/java/dev or hang around a bit and Mr. Tomlinson will tell you about it (he's the author)... <G> -- /--------------------\ | Jerry McBride | | [hidden email] | \--------------------/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to [hidden email] with the following message in the body of the note unsubscribe ibm-netrexx <e-mail address> |
Free forum by Nabble | Edit this page |