Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the File-Inplace CPAN distribution.

Report information
The Basics
Id: 63940
Status: new
Priority: 0/
Queue: File-Inplace

People
Owner: Nobody in particular
Requestors: Jeff.Fearn [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.20
Fixed in: (no value)



Subject: Build fails on Win32 [patch]
Download (untitled) / with headers
text/plain 155b
Hi, Windows barfs when you try and rename a file when it's open. Attached is a short patch that moves the calls to _close_all before rename. Cheers, Jeff.
Subject: win32.diff
Download win32.diff
text/x-diff 950b
Only in File-Inplace-0.20.p: Makefile.old diff -ur File-Inplace-0.20/lib/File/Inplace.pm File-Inplace-0.20.p/lib/File/Inplace.pm --- File-Inplace-0.20/lib/File/Inplace.pm Sat Jan 29 03:36:20 2005 +++ File-Inplace-0.20.p/lib/File/Inplace.pm Wed Dec 15 09:14:24 2010 @@ -168,10 +168,12 @@ $self->_write_current_line; - rename $self->{tmpfile} => $self->{file} + $self->_close_all(); + + rename($self->{tmpfile}, $self->{file}) or croak "Can't rename $self->{tmpname} => $self->{file}: $!"; - $self->_close_all(); + return; } sub commit_to_backup { @@ -182,10 +184,12 @@ croak "cannot commit_to_backup if no backup file is in use" unless $self->{backup_name}; - rename $self->{tmpfile} => $self->{backup_name} + $self->_close_all(); + + rename($self->{tmpfile}, $self->{backup_name}) or croak "Can't rename $self->{tmpname} => $self->{backup_name}: $!"; - $self->_close_all(); + return; } sub rollback {


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.