🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4768

Re: How to unmap file ?

#4768
From: Andrue Cope [TeamB]
Date: Wed, 30 Nov 2005 15:04
30 lines
2214 bytes
Juris wrote:

> Delete self - sample.

Yeah that's doing what we said you'd have to. It creates an external
process to delete itself then it closes itself down before the created
process gets around to attempting the delete.

It seems to be doing this through a slightly underhand method though.
It creates the process at a very low priority after boosting itself to
a very high priority. IOW it's setting up a critical race and heavily
biasing the race in favour of itself. Whether this bias is enough to
guarantee successful deletion or just make it very likely I don't know.

I think it would be better and simpler to avoid all the clever trickery
and just have an external process that is responsible for (re)launching
the one you want to delete.

This is actually a very well known and documented technique. The
application the user invokes is just a wrapper and it takes care of
launching the real application and waiting for it to exit. When the
real application exits it signals the wrapper what to do next.

This is used for the purpose you seem to need and also to relaunch
processes if/when they abend.

-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <438dbf46@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.mediascape.de!newsfeeder.wxs.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4344fc1d$1@newsgroups.borland.com> <438db468@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dbb65edaa3343676
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address>
Subject: Re: How to unmap file ?
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4344fc1d$1@newsgroups.borland.com> <438db468@newsgroups.borland.com>
Date: Wed, 30 Nov 2005 15:04:17 +0000
User-Agent: XanaNews/1.17.6.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <438dbf46@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133363014 217.207.223.34 (30 Nov 2005 07:03:34 -0700)
Lines: 30
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!news.mediascape.de!newsfeeder.wxs.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail