New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPAN.pm error in Win32: uses rename() not File::Copy::move #6814
Comments
From pbwolf@bellatlantic.netCPAN.pm (invoked as cpan in the command shell) reports a permission diff:
CPAN.pm has many other instances of rename(). I haven't checked them. This is a bug report for perl from pbwolf@bellatlantic.net, Flags: Site configuration information for perl v5.8.1: Configured by pbwolf at Sun Sep 28 22:53:03 2003. Summary of my perl5 (revision 5 version 8 subversion 1) configuration: Locally applied patches: @INC for perl v5.8.1: Environment for perl v5.8.1: |
From @esertePhill Wolf (via RT) <perlbug-followup@perl.org> writes:
In this case an entry for rename() in perlport.pod is also missing. Regards, -- tkrevdiff - graphical display of diffs between revisions (RCS, CVS or SVN) |
From schubiger@cpan.orgOn 07 Oct 2003 00:00:13 +0200, Slaven Rezic <slaven@rezic.de> wrote: :> CPAN.pm (invoked as cpan in the command shell) reports a permission Inline Patch--- bleadperl/pod/perlport.pod Fri Nov 12 22:13:04 2004
+++ perlport.pod Sat Apr 2 23:29:09 2005
@@ -1836,6 +1836,10 @@
Not implemented. (Win32, VMS, S<RISC OS>)
+=item rename OLDFILE,NEWFILE
+
+Can't move files. (Win32)
+
=item select RBITS,WBITS,EBITS,TIMEOUT
Only implemented on sockets. (Win32, VMS)
-- Steven Schubiger |
From @janduboisOn Sat, 02 Apr 2005, Steven Schubiger wrote:
This is actually not exactly true. rename() can move files to different Cheers,
|
From perl5-porters@ton.iguana.beIn article <200504022140.j32Le3uL010908@accognoscere.homeunix.org>,
|
From @steve-m-hayJan Dubois wrote:
On my WinXP box, rename() can move files to different directories, It seems to be rename()'ing directories that causes problems: - Steve Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @steve-m-hayTon Hospel wrote:
How about: Can't move directories between directories on different drives (Win32) ? Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @demerphqOn Apr 4, 2005 6:28 PM, Steve Hay <steve.hay@uk.radan.com> wrote:
Shouldnt that be "logical volumes" or "logical devices"? Yves -- |
From @janduboisOn Mon, 04 Apr 2005, Steve Hay wrote:
Yes, you are right. The limitation only applies to directories, which I'm not sure if moving files to a different volume works under Win9X though, Cheers, |
From pbwolf@verizon.netFYI, I was using W2K when I encountered the problem with the CPAN module's use of rename().
|
From schubiger@cpan.orgAttached is the improved patch. Steven |
From schubiger@cpan.orgperlport.pod.patch--- perlport.pod.orig Fri Nov 12 22:13:04 2004
+++ perlport.pod Thu Apr 7 22:30:55 2005
@@ -1836,6 +1836,10 @@
Not implemented. (Win32, VMS, S<RISC OS>)
+=item rename SOURCE,DESTINATION
+
+Can't move directories between directories on different logical volumes. (Win32)
+
=item select RBITS,WBITS,EBITS,TIMEOUT
Only implemented on sockets. (Win32, VMS)
|
From @steve-m-haySteven Schubiger wrote:
Thanks. Applied as 24209 (with the argument names changed to match - Steve
Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @schwern
In all the discussion about the behavior of rename() on Win32 the |
From @schwernThe attached patch changes all the unsafe uses of rename() to |
From @schwernCPAN.pm.patch--- lib/CPAN.pm 2005/07/12 06:21:13 1.3
+++ lib/CPAN.pm 2005/07/12 06:22:31
@@ -3977,9 +3977,9 @@
-d $packagedir and $CPAN::Frontend->myprint("Removing previously used ".
"$packagedir\n");
File::Path::rmtree($packagedir);
- rename($distdir,$packagedir) or
- Carp::confess("Couldn't rename $distdir to $packagedir: $!");
- $self->debug(sprintf("renamed distdir[%s] to packagedir[%s] -e[%s]-d[%s]",
+ File::Copy::move($distdir,$packagedir) or
+ Carp::confess("Couldn't move $distdir to $packagedir: $!");
+ $self->debug(sprintf("moved distdir[%s] to packagedir[%s] -e[%s]-d[%s]",
$distdir,
$packagedir,
-e $packagedir,
@@ -4000,7 +4000,7 @@
my($f);
for $f (@readdir) { # is already without "." and ".."
my $to = File::Spec->catdir($packagedir,$f);
- rename($f,$to) or Carp::confess("Couldn't rename $f to $to: $!");
+ File::Copy::move($f,$to) or Carp::confess("Couldn't move $f to $to: $!");
}
}
if ($CPAN::Signal){
|
From @steve-m-hayMichael G Schwern via RT wrote:
Thanks. Applied as change 25125. Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @steve-m-hayNow fixed in bleadperl so should be in 5.8.8, otherwise in 5.10. |
@steve-m-hay - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#24119 (status was 'resolved')
Searchable as RT24119$
The text was updated successfully, but these errors were encountered: