- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: FTP vs. SFTP behavior differences
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
Discussions
Discussions
Forums
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
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
тАО01-14-2008 01:34 PM
тАО01-14-2008 01:34 PM
FTP vs. SFTP behavior differences
Therefore, it appears that FTP honors the FFB attribute in the file header, but SFTP transfers the entire last 512 byte record. While the last few bytes are nulls (0x00h), the fact that the file is now longer causes problems with the tools on the PC.
Now, I can see that both tools (FTP and SFTP) are doing the Right Thing (FTP honors the FFB attribute, while SFTP says "the file header says 512 byte/fixed records, so that's what I'm sending").
If we could simply use FTP, we'd be all set (and I wouldn't be posting this), but we need to run this over an SSH connection (hence the SFTP).
So, how do we get SFTP to transfer the correct number of bytes in the file -- that is, recognize the FFB attribute and only send that many bytes from the last record?
Thanks!
- Tags:
- sftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 02:01 PM
тАО01-14-2008 02:01 PM
Re: FTP vs. SFTP behavior differences
The good news is that it is easy to do on VMS.
Consider
$ convert/fdl=sys$input: sftp_dir.tmp sftp_dir.cmd
RECORD; FORMAT STREAM_LF
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1185836
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 02:29 PM
тАО01-14-2008 02:29 PM
Re: FTP vs. SFTP behavior differences
Converting the file to Stream_LF using the CONVERT utility increases the filesize (as seen on OpenVMS), and this will cause the (locally written) OpenVMS tools to fail. Furthermore, the resulting file on the PC (after both FTP and SFTP) is larger than the original.
Which leads me to, how 'bout just setting the record format to Stream_LF. But, that doesn't work either, in that the resulting file will have an extra LF at the end of the file on the PC.
One thing we tried was setting RFM:UDF, and this seems to work with SFTP, but now the OpenVMS tools don't work
So far, it's coming down to how to get SFTP to only send the FFB bytes from the last block or record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 02:36 PM
тАО01-14-2008 02:36 PM
Re: FTP vs. SFTP behavior differences
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 02:58 PM
тАО01-14-2008 02:58 PM
Re: FTP vs. SFTP behavior differences
> correct number of bytes in the file [...]?
Complain to HP?
If it's not too much trouble, you might try
using Zip on the VMS side, and UnZip (of some
sort) on the Windows side. I don't guarantee
that it will work, but it should hide the
actual record attributes from SFTP.
> One thing we tried was setting RFM:UDF, and
> this seems to work with SFTP, but now the
> OpenVMS tools don't work
What are "the OpenVMS tools" which don't
work?
Of course, the Zip scheme is probably more
work than setting the file attributes, doing
the SFTP, and resetting them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 03:16 PM
тАО01-14-2008 03:16 PM
Re: FTP vs. SFTP behavior differences
Obviously you need to convert the file into something that SFTP will transfer in a form that your PCs understand. What if the extra bytes were all nulls? A simple way to make that happen might be to enable highwater marking on the source volume.
If the files are small enough (<32K), you might get away with setting the record length to the TOTAL size of the file.
$ SET FILE/ATTR=(RFM:FIXED,MRS:total,LRL:total)
(I can never remember if it's MRS or LRL, to set a fixed length so I just set both)
If it's >23K, perhaps find a factor of the total size <32K and set the fixed length to that size. Of course, if it's a prime number >32K you're out of luck ;-)
Another option might be to write a little utility on the PC which you can invoke via SSH to truncate the file to the "correct" size after copying. Since you know the FFB, you can send it in the SSH command.
BTW, on V8.3 and above it's even easier to convert:
$ convert/fdl="RECORD; FORMAT STREAM_LF
" sftp_dir.tmp sftp_dir.cmd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 03:23 PM
тАО01-14-2008 03:23 PM
Re: FTP vs. SFTP behavior differences
> One thing we tried was setting RFM:UDF, and
> this seems to work with SFTP, but now the
> OpenVMS tools don't work
OK, so you set the file to UDF, copy it, to the PC, then set it back to FIX for the OpenVMS tools?
You could report this to HP, BUT keep in mind your comment about RFM:FIXED and FFB. If this were accepted as a bug report, I'd expect the most likely result would be to "fix" FTP which is arguably the incorrect behaviour. RFM:FIXED is exactly what it says!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2008 04:23 PM
тАО01-14-2008 04:23 PM
Re: FTP vs. SFTP behavior differences
I'd suggest moving to a transfer format that is more portable (XML, XML-encoded or encapsulated binary data, or your own wad of binary data) and particularly to an approach rather less dependent on the vagaries of either Windows or of OpenVMS. (But then you very likely know that is the best approach, and have an installed base you have to deal with.)
IIRC, there have been some fixes in this area over the years within RMS, too. LRL has seen a few tweaks, and FFB and EOF have seen changes.
From the FAQ: "The number of bytes in a file can be determined by multiplying the number of blocks allocated for the file times the number of bytes in a block. For sequential files (only), the FFB (XAB$W_FFB, in the File Header XAB) value can be used to find out how much of the last (XAB$L_EBK) block is used. FFB and EBK are meaningful only for sequential files, and only in a limited context-partial block allocations are not permitted. For other file formats, the EOF marker is not meaningful."
The RMS manual specifically says that the FFB field is only meaningful for sequential files. Which one could infer as indicating that this usage is unsupported, at best.
Stephen Hoffman
HoffmanLabs LLC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2008 12:40 AM
тАО01-15-2008 12:40 AM
Re: FTP vs. SFTP behavior differences
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2008 12:43 AM
тАО01-15-2008 12:43 AM
Re: FTP vs. SFTP behavior differences
STUNNEL is available for VMS (see the open source tools page on HPs VMS site), and Unix type systems, just don't know if and how for Windows.