DBM-Deep
view release on metacpan or search on metacpan
lib/DBM/Deep/Storage/File.pm view on Meta::CPAN
sub copy_stats {
my $self = shift;
my ($temp_filename) = @_;
my @stats = stat( $self->{fh} );
my $perms = $stats[2] & 07777;
my $uid = $stats[4];
my $gid = $stats[5];
chown( $uid, $gid, $temp_filename );
chmod( $perms, $temp_filename );
}
sub flush {
my $self = shift;
# Flush the filehandle
my $old_fh = select $self->{fh};
my $old_af = $|; $| = 1; $| = $old_af;
select $old_fh;
t/44_upgrade_db.t view on Meta::CPAN
'1.00', '1.000', '1.0000', '1.0001', '1.0002',
'1.0003', '1.0004', '1.0005', '1.0006', '1.0007', '1.0008', '1.0009', '1.0010',
'1.0011', '1.0012', '1.0013', '1.0014', '2.0000'
);
foreach my $input_filename (
map {
File::Spec->catfile( qw( t etc ), "db-$_" )
} @input_files
) {
# chmod it writable because old DBM::Deep versions don't handle readonly
# files correctly. This is fixed in DBM::Deep 1.0000
chmod 0600, $input_filename;
foreach my $v ( @output_versions ) {
my (undef, $output_filename) = new_fh();
my $output = run_prog(
$PROG,
"-input $input_filename",
"-output $output_filename",
"-version $v",
);
utils/lib/DBM/Deep/09830.pm view on Meta::CPAN
undef $db_temp;
##
# Attempt to copy user, group and permissions over to new file
##
my @stats = stat($self->_fh);
my $perms = $stats[2] & 07777;
my $uid = $stats[4];
my $gid = $stats[5];
chown( $uid, $gid, $self->_root->{file} . '.tmp' );
chmod( $perms, $self->_root->{file} . '.tmp' );
# q.v. perlport for more information on this variable
if ( $^O eq 'MSWin32' || $^O eq 'cygwin' ) {
##
# Potential race condition when optmizing on Win32 with locking.
# The Windows filesystem requires that the filehandle be closed
# before it is overwritten with rename(). This could be redone
# with a soft copy.
##
$self->unlock();
utils/lib/DBM/Deep/10002.pm view on Meta::CPAN
undef $db_temp;
##
# Attempt to copy user, group and permissions over to new file
##
my @stats = stat($self->_fh);
my $perms = $stats[2] & 07777;
my $uid = $stats[4];
my $gid = $stats[5];
chown( $uid, $gid, $self->_storage->{file} . '.tmp' );
chmod( $perms, $self->_storage->{file} . '.tmp' );
# q.v. perlport for more information on this variable
if ( $^O eq 'MSWin32' || $^O eq 'cygwin' ) {
##
# Potential race condition when optmizing on Win32 with locking.
# The Windows filesystem requires that the filehandle be closed
# before it is overwritten with rename(). This could be redone
# with a soft copy.
##
$self->unlock();
( run in 0.509 second using v1.01-cache-2.11-cpan-496ff517765 )