One little endian question
Brian K. White
brian at aljex.com
Sun Mar 2 12:53:04 PST 2008
Maybe you can perform an empirical test.
Ship the app with a file that has a known value if read on little-endian.
Read the file and test if the value is what you expect.
You can do all that behind the scenes as part of a setup procedure.
You could probably create the test data on the fly even.
Use file i/o or something to write out an explicit string of bytes that
forms a valid structure of some sort in little-endian
The test data/file probably doesn't necessarily have to be a filepro 20 byte
header.
It can be anything that filepro will read according to the endianness of the
platform.
Is ordinary data in files subject to that? ordinary strings? maybe you don't
even have to write a file, just create a string and then interpret it with
some filepro function? Thats desireable for another reason, if you ship the
app with a special test file, you'd have to watch out for xfer having
"fixed" your test file!
Then neither you nor the user has to know or care what the @os is or the cpu
or the endianness of the platform....most of the time.
Every time you transfer the installed app between platforms with different
endianness, the app would have to be reconfigured, or else have it perform
the test every time it runs. But this already applies to every filepro
install and app and dataset out there since day one, and I dare say none of
us has any endianness tests in our normal apps and we survived this long :)
--
Brian K. White brian at aljex.com http://www.myspace.com/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
----- Original Message -----
From: "Jeff Harrison" <jeffaharrison at yahoo.com>
To: "Jay R. Ashworth" <jra at baylink.com>; <filepro-list at lists.celestial.com>
Sent: Sunday, March 02, 2008 3:10 PM
Subject: Re: One little endian question
>
> --- "Jay R. Ashworth" <jra at baylink.com> wrote:
>
>> On Sat, Mar 01, 2008 at 09:40:46PM -0800, Jeff
>> Harrison wrote:
>> > Not so perfect :( Apparently get16 is not
>> available
>> > until version 5.6. I was hoping for something 5.0
>> or
>> > earlier. I guess I'm back to trying to figure the
>> @os
>> > values for big vs little endian.
>>
>> I dunno from @os, but
>>
>> http://en.wikipedia.org/wiki/Endianness
>>
>> is pretty comprehensive about CPUs, at least for
>> your target audience,
>> I think.
>>
>> Cheers,
>> -- jra
>> --
>
> Thanks. That was very enlightening. However, I don't
> see how that helps me directly. I need to know from
> within a filepro application what the native byte
> order is. How can I tell that?
>
> If necessary, I suppose I can assume little endian,
> and give the user the option to change this if
> necessary.
>
> Jeff Harrison
> jeffaharrison at yahoo.com
>
> Author of JHExport and JHImport. The fastest and
> easiest ways to generate filepro exports and imports.
>
>
>
> ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.21.2/1304 - Release Date: 2/29/2008
> 8:18 AM
>
>
More information about the Filepro-list
mailing list