Bio-VertRes-Config
view release on metacpan or search on metacpan
lib/Bio/VertRes/Config/CommandLine/LogParameters.pm view on Meta::CPAN
if ( !( -e $self->log_file ) ) {
my ( $config_filename, $directories, $suffix ) = fileparse( $self->log_file );
make_path($directories, {mode => $mode});
}
open( my $fh, '+>>', $self->log_file )
or Bio::VertRes::Config::Exceptions::FileCantBeModified->throw(
error => 'Couldnt open file for writing ' . $self->log_file );
print {$fh} $self->_output_string;
close($fh);
chmod $mode, $self->log_file;
return 1;
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
lib/Bio/VertRes/Config/Pipelines/Common.pm view on Meta::CPAN
my ( $config_filename, $directories, $suffix ) = fileparse( $self->config );
make_path( $directories, {mode => $mode} );
}
# If the file exists and you dont want to overwrite existing files, skip it
return if ( ( -e $self->config ) && $self->overwrite_existing_config_file == 0 );
# dont print out an extra wrapper variable
$Data::Dumper::Terse = 1;
write_file( $self->config, Dumper( $self->to_hash ) );
chmod $mode, $self->config;
}
sub to_hash {
my ($self) = @_;
my %output_hash = (
root => $self->root,
module => $self->module,
prefix => $self->prefix,
log => $self->log,
lib/Bio/VertRes/Config/RegisterStudy.pm view on Meta::CPAN
if(!(-e $self->study_file_name))
{
my($overall_config_filename, $directories, $suffix) = fileparse($self->study_file_name);
make_path($directories, {mode => $mode});
}
# Study is not in the file so append it to the end, or create a file if it doesnt exist
open(my $study_file_name_write_fh, '+>>', $self->study_file_name) or Bio::VertRes::Config::Exceptions::FileDoesntExist->throw(error => 'Couldnt open file for append '.$self->study_file_name);
print {$study_file_name_write_fh} $self->study_name."\n";
close($study_file_name_write_fh);
chmod $mode, $self->study_file_name;
return $self;
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
lib/Bio/VertRes/Config/TopLevel.pm view on Meta::CPAN
make_path($directories, { mode => $mode });
}
open(my $overall_config_fh, '+>>', $self->overall_config) or Bio::VertRes::Config::Exceptions::FileCantBeModified->throw(error => 'Couldnt open file for writing '.$self->overall_config);
for my $filename (keys %{$self->_filenames_to_action})
{
print {$overall_config_fh} $self->_filenames_to_action->{$filename}.' '.$filename."\n";
}
close($overall_config_fh);
chmod $mode, $self->overall_config;
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
=pod
( run in 0.281 second using v1.01-cache-2.11-cpan-496ff517765 )