I have a program that I want to ensure only runs once. That is
only one copy is running on any of the network computers at any
one time. The program is always stored in the on only one of the
network computers and is alway in the same directory.
.
What I figured I would do, at the start up of the program, is
to open a file for exclusive access and have an error check to
see if the file can not be opened which would indicate that the
program is already running. If this occurs the program (second one)
will immediately end.
.
This approach seams to be working to prevent a network user from
running the program when someone else is running it.
.
Does anyone see any problems with this approach?
------------------
only one copy is running on any of the network computers at any
one time. The program is always stored in the on only one of the
network computers and is alway in the same directory.
.
What I figured I would do, at the start up of the program, is
to open a file for exclusive access and have an error check to
see if the file can not be opened which would indicate that the
program is already running. If this occurs the program (second one)
will immediately end.
.
This approach seams to be working to prevent a network user from
running the program when someone else is running it.
.
Does anyone see any problems with this approach?
------------------
Comment