Skip Menu |

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]
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
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 {