We know that this format is in "little endian". Is your processor also "little endian", e.g. an Intel processor? If it is then maybe we don't have to write completely platform independent code?
I think also relevant to this would be: Is your Perl version 32 or 64 bit? I am running 64 bit Perl on a 64 bit Windows platform. And I have a 64 bit GCC complier. On my 64 bit machine, in C, a simple float is 64 bits. I don't know for sure, but I would suspect that 64 bit Perl's representation of a simple float is also 64 bits? Added: I see trouble if you are using 32 bit Perl.
I don't know where the 6 comes from in 'nCCV(V)6'? Each float is 8 bytes, not 6 bytes.
From what I understand so far,
index 8, length 8 bytes => minx
index 16.length 8 bytes => maxx
index 24,length 8 bytes => miny
index 32,length 8 bytes => maxy
index 40,length 8 bytes => minz
index 48.length 8 bytes => maxz
so, my $minx = unpack ("d8", substr($geo,8,8)); may work??
I am not sure if f8 would work also?
Update: BTW, what is length ($geo)?
Also, again, I request the binary data dump of $geo, NOT what you think that binary unpacks as.
Dump should be 2 hex digits per byte, with a space between bytes. 0 should be 00 so that
columns line up nicely. 16 bytes per line would be fine.
In reply to Re^7: Geo Package files
by Marshall
in thread Geo Package files
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |