Hi Dieter,

  This failed to reach the list the first time, but it's just as well
because not only did I fail to copy the list address correctly, but I failed
to include my perldl log file as promised.  Here's another try.

------------ begin file: flextest.log --------------
...
ReadLines, NiceSlice, MultiLines  enabled
Reading PDL/default.perldlrc...
Found docs database /usr/lib/perl5/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.4.2 (supports bad values)

Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)

perldl> use
PDL::IO::FlexRaw



perldl> $pdl1=pdl [ [ 1,2,3], [4,5,6], [7,8,9], [10,11,12],
]


perldl> $pdl2=pdl [ 13,14,15,16,17,
]


perldl> $pdl3=pdl [ [ [ 18,19, ], [ 20,21, ], ], [ [ 22,23, ], [ 24,25, ],
], [ [ 26,27, ], [ 28,2
9, ], ], ]

perldl> $hdr=writeflex "flextest.f77", $pdl1, $pdl2,
$pdl3


perldl> p
$hdr


ARRAY(0x899a1bc)
perldl> p
@$hdr


HASH(0x86b5a24) HASH(0x87e82b4) HASH(0x8987edc)
perldl> p ( @$hdr
)


HASH(0x86b5a24) HASH(0x87e82b4) HASH(0x8987edc)
perldl> p map
%$_,@$hdr


NDims 2 Type double Dims ARRAY(0x87ed8c0) NDims 1 Type double Dims
ARRAY(0x87e81b8) NDims 3 Type d
ouble Dims ARRAY(0x897229c)
perldl> writeflexhdr
"flextest.hdr",$hdr



perldl> @$pdls=mapflex
'flextest.f77',$hdr


perldl> p
@$pdls



[
 [  0   0   0]
 [  0   0   0]
 [240  63   0]
 [  0   0   0]
]
 [0 0 0 64 0]
[
 [
  [0 0]
  [0 0]
 ]
 [
  [ 0  8]
  [64  0]
 ]
 [
  [0 0]
  [0 0]
 ]
]

perldl>
$orgs=[$pdl1,$pdl2,$pdl3,]



perldl> p
@$orgs



[
 [ 1  2  3]
 [ 4  5  6]
 [ 7  8  9]
 [10 11 12]
]
 [13 14 15 16 17]
[
 [
  [18 19]
  [20 21]
 ]
 [
  [22 23]
  [24 25]
 ]
 [
  [26 27]
  [28 29]
 ]
]

perldl> $pdlz=[mapflex
'flextest.f77',$hdr]


perldl> p
@$pdlz



[
 [  0   0   0]
 [  0   0   0]
 [240  63   0]
 [  0   0   0]
]
 [0 0 0 64 0]
[
 [
  [0 0]
  [0 0]
 ]
 [
  [ 0  8]
  [64  0]
 ]
 [
  [0 0]
  [0 0]
 ]
]

perldl> $pdlss=[readflex
'flextest.f77',$hdr]


perldl> p
$pdlss


ARRAY(0x89bc338)

perldl> p
@$pdlss



[
 [ 1  2  3]
 [ 4  5  6]
 [ 7  8  9]
 [10 11 12]
]
 [13 14 15 16 17]
[
 [
  [18 19]
  [20 21]
 ]
 [
  [22 23]
  [24 25]
 ]
 [
  [26 27]
  [28 29]
 ]
]

perldl>
q


Warning: special data without datasv is not freed currently!! during global
destruction.
Warning: special data without datasv is not freed currently!! during global
destruction.
Warning: special data without datasv is not freed currently!! during global
destruction.
Warning: special data without datasv is not freed currently!! during global
destruction.
Warning: special data without datasv is not freed currently!! during global
destruction.
Warning: special data without datasv is not freed currently!! during global
destruction.

[EMAIL PROTECTED]:~$ more flextest.hdr >> flextest.log
# Output from PDL::IO::writeflex, data in flextest.hdr
double
2
3 4

double
1
5

double
3
2 2 3

------------ finis file: flextest.log --------------

---------- Forwarded message ----------
From: Dystan Hays <[EMAIL PROTECTED]>
Date: Wed, Jul 23, 2008 at 6:10 PM
Subject: Re: [Perldl] PDL::IO::FlexRaw: mapflex trouble on subsequent
piddles
To: [EMAIL PROTECTED], Dieter Meinert <[EMAIL PROTECTED]>


Hi Dieter,

  I don't have any experience with this, but here's the transcript of a test
I made because
I'm curious about this issue.  I'll include it inline and as a separate
attachment.  The length
is just over 4.5K bytes.  I get similar results as you report: works with
readflex, but not with mapflex.  There may be useful information contained
in the differences between your take on how to do it and mine.  My failed
results, as a result of those differences, were different than yours.

  I may get a chance to read the source and, if so, I'll report what I find
there and with further experiments based on what I learn.

                  regards,   -- John Kirk <[EMAIL PROTECTED]>
                                     (267) 882-7777

On Thu, Jul 17, 2008 at 10:35 AM, Dieter Meinert <[EMAIL PROTECTED]>
wrote:

> I'm trying to get data from several files using memory-mapped input,
> i.e. I wrote the files with writeflex($outfile, $pdl1, $pdl2,...)
> and now I try to get their contents into a set of  arrays
> ($h[$i],$x[$i],$y[$i]) = mapflex($infile[$i], {READONLY => 1});
> Unfortunately, all $h,$x,$y contain tidentical data, i.e. those from the
> last file mapped, $infile[max($i)]  ...
> N.B. Using readflex instead, I get the expected results. ...
>

Attachment: flextest.log
Description: Binary data

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to