Preventing 'File is in use'

Q: How do I test if an application is already running to prevent a 'file is in use' error?

A: See APPFLAG.CC in the duflp library.
(The DUFLP libarary can be downloaded here:

This class was written to test a unique system-wide global
flag for an application that can be used to determine if the
application is already running.