From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:6253:: with SMTP id w80mr210806qkb.237.1631136238505; Wed, 08 Sep 2021 14:23:58 -0700 (PDT) X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr406134ybu.91.1631136238314; Wed, 08 Sep 2021 14:23:58 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 8 Sep 2021 14:23:58 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Single-Instance Executable, TSR-style programs, "lockfiles" and the DSA From: Shark8 Injection-Date: Wed, 08 Sep 2021 21:23:58 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62676 List-Id: I'm currently engaged in writing a series of programs for some scientists t= o control a few cameras; one system is a sort of cobbled together web-progr= am, distributed across several computers [PHP for interface + C++ for mesag= e-slinging and camera-control], while the other is a single computer basica= lly running the camera's manufacturer's program. -- This is mostly about th= e latter, though as the former will need to be addressed [via DSA(?)] in th= e near future. There is another system that I'm not touching (for now) which uses lockfile= s; sometimes (crashes and erroneous shutdowns) will leave the lockfiles beh= ind. I have a controlled type-wrapper that will close its file if it is sti= ll open, and that could easily be adapted to delete them on finalization in= the case of a lockfile. -- (#1) What is the best way that the community ha= s come up with regarding lockfiles or similar functionality? In this particular case, the lockfile represents that the control software = for a particular instrument is already running, which brought to mind the o= ld DOS TSRs where you would boot up the program and could call it (or anoth= er program using its services) again to achieve some different/special effe= cts, which then brought to mind the new single-instance executables. Now, o= bviously the DSA can be used in this manner so that one partition provides = services and the client partition queries/quits as needed. -- (#2) Is ther= e a non-DSA, and hopefully portable, Ada way to achieve single-instance exe= cutables? [I haven't had any luck trying web-searches on this topic.]