lib/CrashTest/Storage/FileSystem.pm
changeset 19 300b902b5461
parent 12 c98d3fa4a948
child 24 b69b7aa98a1d
--- a/lib/CrashTest/Storage/FileSystem.pm	Sat Apr 06 22:50:55 2013 +0200
+++ b/lib/CrashTest/Storage/FileSystem.pm	Sun Apr 07 00:02:00 2013 +0200
@@ -17,9 +17,9 @@
 use warnings;
 
 sub new {
-    my ($class, $data_path) = @_;
+    my ($class, $config) = @_;
     my $self  = {};
-    $self->{data_path} = $data_path;
+    $self->{data_path} = $config->{DataDir};
     bless ($self, $class);
     return $self;
 }
@@ -79,7 +79,10 @@
     my ($self, $uuid, $file) = @_;
 
     my $dmp_file = File::Spec->catfile($self->{data_path}, "$uuid.dmp");
-    $file->move_to($dmp_file);
+    my $fh = IO::File->new($dmp_file, "w") or die($!);
+    $fh->binmode;
+    print $fh $file;
+    undef $fh;
 }
 
 1;