Single copy of BlitzMax program

BlitzMax Forums/BlitzMax Programming/Single copy of BlitzMax program

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

No, the idea is very simple -- I open an empty file for writing and keep it while the program is working. If an instance of the program is already running, I cannot delete it. So, if I try to delete the file and can't (FileType(fname)<>0), this means that one instance is already working, so I quit. If I can delete the file, this means that I'm running for the first time, so, I reopen the file for writing and start the program. This works even if the program crashes or shuts down unexpectedly.