🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Spawning and Deleteing an exe file

#15129
From: Steve Craig
Date: Wed, 16 Jul 2003 09:37
30 lines
2196 bytes
Ed

Thanks for the response.  I tried your suggestion but it's still exhibiting
the same problem. It is very strange behavior, the file is not accessible, I
can't rename, copy or delete the file until I reboot. BTW I am using BCB 5.0
on windows 2000.
Anyway, I am going to try a different (although a little clumsy) alternative
using a bat file.  Thanks again...

Steve

"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3f128e58@newsgroups.borland.com...
> You might try using CreateProcess and telling it to create a new process
> group.  Windows protects the exe files of executing programs.
>
> When using the spawn* family that program will default to being part of
the
> same process group as the program that spawned it.  The file may be
> protected until the calling process is ended.  With a new process group
you
> have a chance of being able to delete it after it finishes running.
>
> You will need to use some semaphore or mutex call such as
> WaitForSingleObject to detect when the program is no longer running.
>
> When asking something like this it would be useful if you mentioned what
> operating system and version and what compiler and version are being used.
>
> .  Ed
Technical Details
Message-ID: <3f151e0f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f127f9c@newsgroups.borland.com> <3f128e58@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,8871a81884d35a65
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-16 02:51:26 PST
From: "Steve Craig" <stevecraig@ozemail.com.au>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f127f9c@newsgroups.borland.com> <3f128e58@newsgroups.borland.com>
Subject: Re: Spawning and Deleteing an exe file
Date: Wed, 16 Jul 2003 19:37:23 +1000
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 203.103.158.90
Message-ID: <3f151e0f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058348559 203.103.158.90 (16 Jul 2003 02:42:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail