- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: FTP between Windows & HPUX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 12:50 AM
10-26-2005 12:50 AM
FTP between Windows & HPUX
In FTP, when using a mix of Windows and Unix systems then the FTP should be set use "ASCII Mode".
In this mode end-of-line sequences should be handled correctly (namely, from LINEFEED on Unix, to CARRIAGE_RETURN/LINEFEED on Windows).
However, what we see when using this mode with the HP box is that we are getting the interpretation of LF to CR/LF seemingly done by the HP box, not by the FTP process. As a result, when we transfer a file of, say, 100 records it will be 100 data bytes short - though actually exactly the same number of bytes overall. What has happened is that each record is padded with the CR character, and real data is truncated off the end.
One way to fix this, seemingly, is to set Comlink to use "BINARY" mode. This should bring over the file "as is", without conversions. But instead, in this case, we get the correct file, with CR/LF and the right number of total bytes.
Since this doesn't happen with Sun and DG boxes, my guess is that it is somewhere in the setup of the FTP "daemon" on the HP box. Alternatively, the Comlink front-end is jiggered (getting things the wrong way round) - but if that was the case, I'm sure we'd know about it already!
Thanks,
Tony.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 04:17 AM
10-26-2005 04:17 AM
Re: FTP between Windows & HPUX
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 04:24 AM
10-26-2005 04:24 AM
Re: FTP between Windows & HPUX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 04:26 AM
10-26-2005 04:26 AM
Re: FTP between Windows & HPUX
Tony.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 04:29 AM
10-26-2005 04:29 AM
Re: FTP between Windows & HPUX
You might experiment with this command and post your results?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 05:07 AM
10-26-2005 05:07 AM
Re: FTP between Windows & HPUX
Its not an HP-UX problem.
the Windows ftp client is a piece of junk.
1) It defaults to ascii and leaves it up the the user to switch to binary.
2)It is not smart enough to automatically determine the filetype as sftp does.
Your best solution is to stop using ftp all together. Buy yourself a little free sftp client and install secure shell for free on the hpux side.
If you must use FTP then get a better client. There are decent free one's available on the web.
There is nothing that need be done to the ftpd server on HP-UX. It is for security reasons an excellent idea to download and install the patches.
Some patches are first set up binary only but eventually they are all released in depot format.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 07:43 AM
10-26-2005 07:43 AM
Re: FTP between Windows & HPUX
1. On the local machine, each ASCII record is read in a format-neutral form. The exact length of the record is known to ftp and will be sent to the remote system with nothing on the front of back except the length informtion.
2. On the remote computer, the record is then converted to the native format for that system. For Unix, each line has a line termination character of LF (nothing else) and a null is cteated at the end of the ASCII file signifying the end. On a Windows box, the record is terminated with 2 chars: CR+LF and the end of the file has a CTRL-Z. For mainframes and business computers, the record may be converted to fixed length, or it may have a record length code inserted in front of each record, or a multitude of possible file format features.
So ASCII will almost always corrupt a binary file. What happens is that on the source side, a binary sequence of data might have the equivalent of an LF imbedded in the middle but it isn't an end-of-line indicator. ftp doesn't know this because you lied and said it was ASCII, so the special codes are added as defined by the ASCII translation defined in ftp.
So, NEVER transfer a file in ASCII unless it is really an ASCII file. And if you do transfer an ASCII file using BINARY mode, the source system's internal code will be transferred too and this will confuse the destination system.
So for Windows, a Unix ASCII file trasnferred in BINARY will be displayed by Notepad with little black squares at the end of each line, but open that file in Word or Wordpad and it sort-of looks OK. The LF (which Unix uses) is actually a soft-CR code for Windows word processors.
And for Unix, transfer an ASCII file in BINARY and in vi, you'll see ^M at the end of each line. The reason is that the CR+LF is seen as CR and the end of the line. CR is ^M on the keyboard.
You can filter files like this in HP-UX with dos2ux and ux2dos (see the manp page). NOTE: This is also what happens when sharing files using NFS or SAMBA. The shared filesystem is not translated so the files are effectively seen in BINARU mode.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 08:18 AM
10-26-2005 08:18 AM
Re: FTP between Windows & HPUX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2005 08:02 PM
10-26-2005 08:02 PM
Re: FTP between Windows & HPUX
this is an excerpt from man ftp:
cr Toggle carriage return stripping during ascii type file
retrieval. Records are denoted by a carriage-return/line-feed
sequence during ascii type file transfer. When cr is on (the
default), carriage returns are stripped from this sequence to
conform with the UNIX single line-feed record delimiter. Records
on non-UNIX remote systems may contain single line-feeds; when an
ascii type transfer is made, these line-feeds can be
distinguished from a record delimiter only when cr is off.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 02:41 AM
10-27-2005 02:41 AM
Re: FTP between Windows & HPUX
Managed to solve the problem by tweaking the Windows Comlink.
Tony.