develooper Front page | perl.makemaker | Postings from January 2006

Re: [PATCH] Re: replacing "inuse" Win files (was Re: Help with aCwd.pm build error)

Thread Previous | Thread Next
From:
Linda W
Date:
January 31, 2006 04:16
Subject:
Re: [PATCH] Re: replacing "inuse" Win files (was Re: Help with aCwd.pm build error)
Message ID:
43DEACB5.3010709@tlinx.org
demerphq wrote:
> On 1/30/06, Linda W <perl-diddler@tlinx.org> wrote:
>> demerphq wrote:
>>> We dont need this behaviour as we arent going to be dealing with any
>>> DLL's that will be started prior to perl starting. Move at boot
>>> behaviour is only required for dlls that are loaded at boot. Since the
>>> files we care about are only locked because of Perl we only need close
>>> perl.
>> ---
>>         The Windows API "MoveFileEx" is used to move _any_ DLL that is
>> locked in memory.  It isn't something primarily used by device drivers,
>> but by any "setup" or install program that replaces "DLL"s loaded in
>> memory.
> 
> Hmm, I dont see anything about moving dll's that are locked in memory
> specifically. I do see the MOVEFILE_DELAY_UNTIL_REBOOT stuff tho.
> Which is as you've pointed out a useful thing. (Or horrible kludge,
> whatever :-)
---
	Yeah...a bit kludgey, I'd agree.  There isn't anything specifically
written about rename being allowed: it just works and makes sense on NT
given that it backs demand paged executable images either from its paging
file or directly from a suitable image-file using (device,startblock,#blocks).

>>         The "MoveFileEx" API is supported on both win-nt and win-95 based
>> systems.
> 
> Heh. The documentation on MoveFileEx specifies that the function isn't
> available under Win95. So that is wrong in your experience?
---
	My bad, the full quote was "Windows 95 and Windows NT each provide a unique 
method for helping applications to remove, replace, or rename files and 
directories that are in use. "

	I certainly can't say much about Win95...the article is unclear
about the behavior in 98, 98SE & ME.  It's hard to imagine the
recommended procedure on 98SE & ME being limited to storing renames in a
'wininit.ini' file, but I no longer have a win98 installation to test this on.
Hmmm.


> The original issue stems from the fact that MB uses Cwd to do its
> business, but MB is the module that is responsible for installing Cwd.
> The bigger issue that multiple perl sessions (or other processes)
> could also lock the DLL's actually never occured to me. The chicken
> and egg problem however was hard to avoid. :-)
---
	Yep.  The conveniences we are used to on *nix. :-)

> Anyway, attached is a patch for ExtUtils::MakeMaker::Install that is
> capable of installing Pathtools (ie Cwd) by doing the rename trick
> with MoveFileEx for deletion of the old copy. If the rename fails is
> arranges to do the whole thing at reboot.
---
	Cool!  Just thinking about testing on WinME/9x gives me a
headache though.

Linda

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About