Hmm.... just thought of this:
   For the current process ID, you could create a file
called, say, 3455.pid in the temp directory. Make it 1
byte, and RE-create it every 10 seconds. I don't think
this is too intensive... and it gives you PID
identification accurate to 10 seconds.

  ...Or is the problem that people are opening custom
twice _at the same time_? In that case, if 3455.pid
exists within the timestamp, just stall for 10 seconds
and see if it gets updated. 

  Anyways, I only suggest this because it seems to me
that this is the kind of thing users would expect to
be done for them automatically. Totally up to you
guys.

-->Seth



--- [EMAIL PROTECTED] wrote:

>
http://rpg.hamsterrepublic.com/bugzilla/show_bug.cgi?id=642
> 
> 
> 
> 
> 
> --- Comment #4 from Ralph Versteegen
> <[EMAIL PROTECTED]>  2008-06-23 10:52:05 ---
> (In reply to comment #3)
> > I know how to reliable check the current process's
> PID on both Linux and
> > Windows.
> > 
> > As for checking the name of the process of a given
> PID, I know it is possible
> > on both platforms, but it gets very sketchy.
> pattern matching, possibly
> > external comman execution. Nothing that we aren't
> capable of, but I fear it
> > will be fragile.
> > 
> > And what do we gain from it? Just the information
> of whether or not another
> > copy of custom is running.
> 
> If there is another copy of Custom running with the
> correct PID, the chance of
> it being the instance which is using this
> working.tmp is 32767 out of 32768 or
> whatever, not to mention the fact that if there's
> another instance of Custom at
> all, it's almost certainly the one we meant anyway,
> because I haven't heard of
> anyone purposefully running 2 copies of custom at
> the same time in the first
> place.
> 
> > 
> > I would like to solve this problem just by
> improving the interface.
> > 
> > Consider this:
> > 
> > * custom finds a working.tmp file
> > * Custom asks something like "Is another copy of
> custom running? (y/n)"
> > * Y: (default) shows an explanation of the fact
> that you can only run one at a
> > time, and terminates.
> > * N: then asks "Did custom crash last time you ran
> it? (y/n)"
> > * Y: Run the recovery routine
> > * N: then asks "Do you want to save a backup copy
> of the files anyway? (y/n)"
> > * Y: Run the recovery routine
> > * N: deletes the files
> > 
> > Also, rather than asking you to run custom again,
> it could just proceed as
> > normal. The "please run custom again" thing is a
> little confusing, and the only
> > reason it ever did that was lazy programming on my
> part.
> > 
> > Only the "Do nothing" option really needs to
> terminate. Both recovery and
> > cleanup could just continue.
> > 
> 
> This would be a good improvement, and I guess that
> this would save a lot of
> work on our part. OK then.
> 
> 
> -- 
> Configure bugmail:
>
http://rpg.hamsterrepublic.com/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
> _______________________________________________
> Ohrrpgce mailing list
> [email protected]
>
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> 



      
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to