Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /HDF5/Dataset.pm [387be3] .. [f09adb] Maximize Restore

  Switch to side-by-side view

--- a/HDF5/Dataset.pm
+++ b/HDF5/Dataset.pm
@@ -457,7 +457,14 @@
 	foreach (@pdldims){ $nelems *= $_; }; # calculate the number of elements
 
 	my $datasize = $nelems * PDL::howbig($pdl->get_datatype);
-	my $data = pack("x$datasize"); # create empty space for the data
+	
+	# Create empty space for the data
+	#   Incrementally, to get around problem on win32
+	my $howBig = PDL::howbig($pdl->get_datatype);
+	my $data = ' ' x $howBig;
+	foreach my $dim(@pdldims){
+		$data = $data x $dim;
+	}
 
 	# Read the data:
         $rc = PDL::IO::HDF5::H5Dread($datasetID, $internalhdf5_type, PDL::IO::HDF5::H5S_ALL(), PDL::IO::HDF5::H5S_ALL(),