|
From: Chris W. <la...@us...> - 2001-10-11 13:18:42
|
Update of /cvsroot/openinteract/SPOPS/SPOPS
In directory usw-pr-cvs1:/tmp/cvs-serv12239
Modified Files:
HashFile.pm
Log Message:
rename the extension used by the backup file to '.backup' rather than
'.old' to better convey what it actually is
Index: HashFile.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS/HashFile.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** HashFile.pm 2001/10/11 13:09:26 1.10
--- HashFile.pm 2001/10/11 13:18:40 1.11
***************
*** 57,62 ****
die "Cannot save data: the filename has been erased. Did you assign an empty hash to the object?\n";
}
if ( -f $obj->{filename} ) {
! rename( $obj->{filename}, "$obj->{filename}.old" )
|| die "Cannot rename old file to make room for new one. Error: $!";
}
--- 57,65 ----
die "Cannot save data: the filename has been erased. Did you assign an empty hash to the object?\n";
}
+ if ( -f "$obj->{filename}.backup" ) {
+ unlink( "$obj->{filename.backup" ); # just to be sure...
+ }
if ( -f $obj->{filename} ) {
! rename( $obj->{filename}, "$obj->{filename}.backup" )
|| die "Cannot rename old file to make room for new one. Error: $!";
}
***************
*** 68,72 ****
eval { open( INFO, "> $obj->{filename}" ) || die $! };
if ( $@ ) {
! rename( "$obj->{filename}.old", $obj->{filename} )
|| die "Cannot open file for writing (reason: $@ ) and ",
"cannot move backup file to original place. Reason: $!";
--- 71,75 ----
eval { open( INFO, "> $obj->{filename}" ) || die $! };
if ( $@ ) {
! rename( "$obj->{filename}.backup", $obj->{filename} )
|| die "Cannot open file for writing (reason: $@ ) and ",
"cannot move backup file to original place. Reason: $!";
***************
*** 75,80 ****
print INFO $string;
close( INFO );
! if ( -f "$obj->{filename}.old" ) {
! unlink( "$obj->{filename}.old" )
|| warn "Cannot remove the old data file. It still lingers in $obj->{filename}.old....\n";
}
--- 78,83 ----
print INFO $string;
close( INFO );
! if ( -f "$obj->{filename}.backup" ) {
! unlink( "$obj->{filename}.backup" )
|| warn "Cannot remove the old data file. It still lingers in $obj->{filename}.old....\n";
}
|