From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,a988bcb65ddc0b1c X-Google-Attributes: gidfa528,public X-Google-Thread: f7344,bbc2c03c35f9c8f0 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2001-11-29 01:54:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!62.245.135.170!not-for-mail From: Martin Knoblauch Newsgroups: comp.os.vms,comp.unix.tru64 Subject: Re: Tru64 .vs. HP-UX (was: Compaq's Secret VMS Plans (The Inquirer)) Date: Thu, 29 Nov 2001 10:54:31 +0100 Organization: TeraPort GmbH Message-ID: <3C0605D7.5B093182@TeraPort.de> References: <0033000042788869000002L092*@MHS> <91668821Cwarrenspencer1977@207.126.101.97> <3C04980A.4010005@swissonline.delete.ch> <3C051224.4A2BB9CC@videotron.ca> NNTP-Posting-Host: 62.245.135.170 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1007027672 6679764 62.245.135.170 (16 [115181]) X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.15-greased-turkey i686) X-Accept-Language: en, de Xref: archiver1.google.com comp.os.vms:53198 comp.unix.tru64:5951 Duane Sand wrote: > > What I should have said, is that any automatic byte-swapping > service supplied by the OS or runtime library, is going to be > useless for automatically converting files whose internal > layouts are unknown to the system. So the system generally true for the OS, but not [neccessarily] true for runtime support. The OS of course does not know the internals of a binary input file. The RTL may very well know. The DEC/COMPAQ Frotran compiler has support for reading/writing binary files both ways. I think it can even convert more exotic stuff like the old VAX formats. But of course, the RTL "knows" what to expect when it comes to a binary read. > can't help a big-endian version of an application work together > with a little-endian version of that same application. The > problem is that when items of different sizes are intermixed > in a file or struct, the two-byte numbers must be byte-reversed > on a two-byte basis, and four-byte numbers must be byte- > reversed on a four-byte basis, etc. The system doesn't > know enough about each application's declarations or > methods to know how to parse and reverse each part. > The system doesn't, but the RTL may very well know. See above. > Some cases of file interchange can work via automatic byte > swapping. This includes data bases (whose internal > structures are self-described somewhere), and simple files > where all items are the same size (eg text files), and > Fortran binary files (where the read/write statements show > how to parse each record into bigger and smaller fields). > shoot. I should have read further :-) > The cases that don't work, include C programs reading and > writing structs with scalar fields of different sizes, or > worse yet, unions of those. (And that's most every program > I deal with.) > But in that case, the program was not [trivially] portable from the beginning. I mean, next you will ask that you can read absolute pointer values from a binary file :-)) Martin -- ------------------------------------------------------------------ Martin Knoblauch | email: Martin.Knoblauch@TeraPort.de TeraPort GmbH | Phone: +49-89-510857-309 C+ITS | Fax: +49-89-510857-111 http://www.teraport.de | Mobile: +49-170-4904759