ExtUtils-MakeMaker

 view release on metacpan or  search on metacpan

bundled/ExtUtils-Install/ExtUtils/Install.pm  view on Meta::CPAN


        # *note* CanMoveAtBoot is only incidentally the same condition as below
        # this needs not hold true in the future.
        $Has_Win32API_File = ($Is_Win32 || $Is_cygwin)
            ? (eval {require Win32API::File; 1} || 0)
            : 0 unless defined $Has_Win32API_File;
        if ( ! $Has_Win32API_File ) {

            my @msg=(
                "Cannot schedule $descr at reboot.",
                "Try installing Win32API::File to allow operations on locked files",
                "to be scheduled during reboot. Or try to perform the operation by",
                "hand yourself. (You may need to close other perl processes first)"
            );
            if ( $moan ) { _warnonce(@msg) } else { _choke(@msg) }
            return 0;
        }
        my $opts= Win32API::File::MOVEFILE_DELAY_UNTIL_REBOOT();
        $opts= $opts | Win32API::File::MOVEFILE_REPLACE_EXISTING()
            unless ref $target;

bundled/ExtUtils-Install/ExtUtils/Install.pm  view on Meta::CPAN



=begin _private


=item _unlink_or_rename( $file, $tryhard, $installing )

OS-Specific, Win32/Cygwin

Tries to get a file out of the way by unlinking it or renaming it. On
some OS'es (Win32 based) DLL files can end up locked such that they can
be renamed but not deleted. Likewise sometimes a file can be locked such
that it cant even be renamed or changed except at reboot. To handle
these cases this routine finds a tempfile name that it can either rename
the file out of the way or use as a proxy for the install so that the
rename can happen later (at reboot).

  $file : the file to remove.
  $tryhard : should advanced tricks be used for deletion
  $installing : we are not merely deleting but we want to overwrite

When $tryhard is not true if the unlink fails its fatal. When $tryhard



( run in 0.682 second using v1.01-cache-2.11-cpan-49f99fa48dc )