}
-sub file_store
-{
- # Martin A. Hansen, December 2004.
-
- # writes a data structure to file.
-
- my ( $path, # full path to file
- $data, # data structure
- ) = @_;
-
- Storable::store( $data, $path ) or Maasha::Common::error( qq(Could not write-open file "$path": $!) );
-}
-
-
-sub file_retrieve
-{
- # Martin A. Hansen, December 2004.
-
- # retrieves hash data structure
- # (this routines needs to test if its a hash, array or else)
-
- my ( $path, # full path to data file
- ) = @_;
-
- my ( $data );
-
- $data = Storable::retrieve( $path ) or Maasha::Common::error( qq(Could not read-open file "$path": $!) );
-
- return wantarray ? %{ $data } : $data;
-}
-
-
sub read_args
{
# Martin A. Hansen, December 2006
use strict;
use Data::Dumper;
use Maasha::Common;
+use Maasha::Filesys;
use Maasha::Seq;
use vars qw ( @ISA @EXPORT );
my ( $file_size, $fh, $entry, $beg, $len, %hash, @index );
- $file_size = Maasha::Common::file_size( $path );
+ $file_size = Maasha::Filesys::file_size( $path );
push @index, "FILE_SIZE=$file_size";
- $fh = Maasha::Common::read_open( $path );
+ $fh = Maasha::Filesys::file_read_open( $path );
$beg = 0;
$len = 0;
# returns nothing
- Maasha::Common::file_store( $path, $index );
+ Maasha::Filesys::file_store( $path, $index );
}
my $index;
- $index = Maasha::Common::file_retrieve( $path );
+ $index = Maasha::Filesys::file_retrieve( $path );
return wantarray ? @{ $index } : $index;
}
use strict;
use IO::File;
+use Storable;
use Maasha::Common;
use Exporter;
}
+sub file_store
+{
+ # Martin A. Hansen, December 2004.
+
+ # writes a data structure to file.
+
+ my ( $path, # full path to file
+ $data, # data structure
+ ) = @_;
+
+ Storable::store( $data, $path ) or Maasha::Common::error( qq(Could not write-open file "$path": $!) );
+}
+
+
+sub file_retrieve
+{
+ # Martin A. Hansen, December 2004.
+
+ # retrieves hash data structure
+ # (this routines needs to test if its a hash, array or else)
+
+ my ( $path, # full path to data file
+ ) = @_;
+
+ my ( $data );
+
+ $data = Storable::retrieve( $path ) or Maasha::Common::error( qq(Could not read-open file "$path": $!) );
+
+ return wantarray ? %{ $data } : $data;
+}
+
+
sub file_copy
{
# Martin A. Hansen, November 2008.