Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: danpop@cernapo.cern.ch (Dan Pop )
Subject: Re: Mainframe -> Linux File transfer problem
Date: Fri, 6 Aug 1993 11:20:44 GMT	[thread overview]
Message-ID: <danpop.744636044@cernapo> (raw)
In-Reply-To: 9321811.20026@mulga.cs.mu.OZ.AU

In <9321811.20026@mulga.cs.mu.OZ.AU> kmng@mundil.cs.mu.OZ.AU (Kui Meng NG) writes:
>When a binary file is ftp'ed from a mainframe UNIX machine to a PC with Linux, 
>( using BINARY mode transfer !)
>i think the file gets "scrambled"  due to the different architectures/OS .
>In particular, i think that it could be because one machine is big endian
>and the other little endian.

It depends on your definition of "scrambled". If the file on PC is the same as
the file on the mainframe, at _character_ level, then it is by no means
scrambled. This is exactly what the BINARY mode of ftp is supposed to do.
If your binary file contains integer or floating point data, it is not portable
across different platforms which use different byte orderings or different
representations. In such a case, if portability is a concern, use ASCII files
to store your data, instead of binary files. Otherwise, writing a short
program to fix the byte ordering on the destination machine should be trivial
if you know the internal structure of the file. If you don't, you can simply
throw away the file, because it's useless on the destination machine.

Dan
--
Dan Pop 
Tel:   +41.22.767.2335
Email: danpop@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 21 1-023, CH-1211 Geneve 23, Switzerland


      reply	other threads:[~1993-08-06 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-06  1:22 Mainframe -> Linux File transfer problem Kui Meng NG
1993-08-06 11:20 ` Dan Pop  [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox