Operating System - HP-UX
1833883 Members
1474 Online
110063 Solutions
New Discussion

Re: Files not ok after ftp when HP-UX is acceptor

 
Andriès Christian
New Member

Files not ok after ftp when HP-UX is acceptor

After a transfer from GCOS8 or SOLARIS, when
HP-UX is acceptor, file is bad. When HP-UX
is initiator file is good. HP-UX is always
receiving files.
Sorry for my english. I am french.

Thanks for help
13 REPLIES 13
Helen French
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Just a thought:

Set the file mode when doing ftp. Examples are 'bi' for binary mode and 'as' for ascii mode.
Life is a promise, fulfill it!
Jean-Luc Oudart
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Could you describe the problem "file is bad" ?
Is this a binary file or ascii file ?

They're other french people on the Forum (as well as many other non-native English speaskers) ;-)

Welcome !

JL

fiat lux
PIYUSH D. PATEL
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Hi,

Can you pls tell the procedure which you are using.

Use the ftp command with -d option .ie for debugging and then try.

Any errors logged in syslog.log ??

Piyush
PIYUSH D. PATEL
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Hi,

Can you pls tell the procedure which you are using.

Use the ftp command with -d and -v option .ie for debugging and then try.

Piyush
Kelli Ward
Trusted Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Hi,
I concur with Shiju and Jean-Luc
The problem most likely comes from an ascii binary mis-match.
If your file is a text file type ascii before using get or put. If if is a program file type binary first.
I've been hit by this many times transferring between HP-UX and WinNT.
(Usually by transferring binary files in ascii mode.)
My HP-UX boxes default binary and the NT box defaults ascii.
Good Luck,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Bill McNAMARA_1
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

si hp-ux recois du windows, le serveur ftp d'windos va etre en mode Ascii (text).

Il faut sur le client (hp-ux) dire que vous voulais transferee en mode binaire, avec le commande bin avant de telecharger le ficher.

Bonne chance,
Bill (Grenoble)
It works for me (tm)
Andriès Christian
New Member

Re: Files not ok after ftp when HP-UX is acceptor

Hi
thanks for your answers. I try to explain the problem. The file is created on GCOS8 system.
It is an ascii file with few zones binary (COMP3). The file transfer is set ascii and it is good with AIX and SOLARIS but bad with
HP-UX. Binary zone is interpreted by
HP-UX and not by AIX or SOLARIS.
Jean-Luc Oudart
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

If you have COMP3 fields I suppose you should run a binary transfer.
I don't know much about GCOS8 ( is this a grand child of GCOS6 ?)

Bill, I love your French, but you may prefer to stick to English ;-)

Jean-Luc
fiat lux
Andriès Christian
New Member

Re: Files not ok after ftp when HP-UX is acceptor

Jean-Luc,

GCOS8 n'a aucun rapport avec GCOS6. Le GCOS8 est l'OS des MAINFRAMES (La famille du DPS8 et de ces successeurs ). Je ne peux pas transf??rer
du texte en binaire entre 2 OS diff??rents
Jean-Luc Oudart
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Christian,

I say it in English so everybody can follow up this thread.

1) You can of course transfer binary data between different OS. Interpretation of such data on the target machine might be a problem.

2) Therefore, the solution may be if you can transform the data on your source machine (GCOS8) so it's fully ascii and bypass your pb.

Jean-Luc
fiat lux
Bill Hassell
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Here is what happens with ftp (this is universal to all versions of FTP):

A binary transfer means exactly that. What you see is what you get. The data will appear on the remote side looking exactly like it did on the local side (notwithstanding complex mainframe issues with binary filetypes and record sizes). So if you want exact matches on both sides, always specify binary.

ASCII transfers was designed to be a translator, knowing that each operating system defines ASCII file formats differently. In Unix, each line is followed by a LineFeed character while in DOS(Windows too), each line is followed by a CarriageReturn plus a LineFeed.

So ASCII transfer are quite complicated: On HP-UX, setting ASCII transfers will read each record, look for the LF character, then add a CR character. There is no way for ftp to know that the LF character is actually part of a binary string and it should not be modified. The result is that the destination file will always be larger than the original due to the extra CR's thatwere added.

You will see this in the raw file...look for a hex 0a (or octal 12) and you will find an extra hex 0d (octal 015) has been added. If you transfer ASCII files from a PC, you'll see ^M when you run vi at the end of every line. ^M means CTRL-M which is the CR character. Similarly, transferring an ASCII file from HP-UX to a PC will look OK only if you use Word or Wordpad but will have black squares when opened in Notepad. The reason is that Word/Wordpad recognize LF as a 'sfot carriage return' which is a wordprocessing function.

Always use BINARY, even when only a few fields are binary.


Bill Hassell, sysadmin
Ron Kinner
Honored Contributor

Re: Files not ok after ftp when HP-UX is acceptor

IF Solaris & AIX will not do binary see if they will take: byte

Ron
Rory R Hammond
Trusted Contributor

Re: Files not ok after ftp when HP-UX is acceptor

Soloris, Windows and AIX ftp defaults to ASCII which suggest that you should out of habit always set your transfer mode.

Rory
There are a 100 ways to do things and 97 of them are right