<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FTP vs. SFTP behavior differences in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129136#M55889</link>
    <description>Many thanks for all the suggestions and comments.&lt;BR /&gt;&lt;BR /&gt;The situation is that the file format is fixed (an ISO standard), and it is not practical at this time to change the tools used to create and access this file on OpenVMS.  Furthermore, the remote user needing access to this file is connecting via a VPN where the firewall only allows SSH through (which is why FTP won't work).&lt;BR /&gt;&lt;BR /&gt;However, the remote user also has access to our Unix systems.  Therefore, as a workaround, they are using FTP between the OpenVMS system and the Unix system to get the file onto Unix, and are then using SFTP from the Unix system to their PC (through the VPN firewall).  Yes, I know, it's convoluted, but that's what is currently in place.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;</description>
    <pubDate>Wed, 16 Jan 2008 14:39:17 GMT</pubDate>
    <dc:creator>pcseunix</dc:creator>
    <dc:date>2008-01-16T14:39:17Z</dc:date>
    <item>
      <title>FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129124#M55877</link>
      <description>We have some files that have a RFM:FIXED and a record length of 512.  However, these files have a FFB (first free byte) attribute with a non-zero value.  The data contained in the files is in an undefined (to VMS/RMS) format, but rather the format is special to the application that writes and reads it.  As long as the file stays on OpenVMS, our standard tools all work correctly with it.  But, in transferring one of these files to a PC causes problems.  Using FTP from TCPIP V5.4 works correctly.  That is, the resulting file on the PC is of the correct length.  Using SFTP from the same version TCPIP results in a file that is some number of bytes longer than by using FTP.  The number of bytes longer is the difference between 512 and the FFB attribute value.&lt;BR /&gt;&lt;BR /&gt;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.  &lt;BR /&gt;&lt;BR /&gt;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").  &lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 14 Jan 2008 21:34:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129124#M55877</guid>
      <dc:creator>pcseunix</dc:creator>
      <dc:date>2008-01-14T21:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129125#M55878</link>
      <description>The number one rule for using SFTP from VMS to non-vms host, is to convert all files to stream_lf (unix format).&lt;BR /&gt;The good news is that it is easy to do on VMS.&lt;BR /&gt;&lt;BR /&gt;Consider&lt;BR /&gt;$ convert/fdl=sys$input: sftp_dir.tmp sftp_dir.cmd&lt;BR /&gt;                        RECORD; FORMAT STREAM_LF&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1185836" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1185836&lt;/A&gt;</description>
      <pubDate>Mon, 14 Jan 2008 22:01:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129125#M55878</guid>
      <dc:creator>Thomas Ritter</dc:creator>
      <dc:date>2008-01-14T22:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129126#M55879</link>
      <description>Thanks for the quick reply.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;One thing we tried was setting RFM:UDF, and this seems to work with SFTP, but now the OpenVMS tools don't work&lt;BR /&gt;&lt;BR /&gt;So far, it's coming down to how to get SFTP to only send the FFB bytes from the last block or record.</description>
      <pubDate>Mon, 14 Jan 2008 22:29:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129126#M55879</guid>
      <dc:creator>pcseunix</dc:creator>
      <dc:date>2008-01-14T22:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129127#M55880</link>
      <description>Well that's bad news. Having just deployed a number of SFTP based file transfer systems I only repeat my advise. I suggest you have your tools upgraded or modified. Why don't they work ? COBOL programs ? The changes required maybe very small.</description>
      <pubDate>Mon, 14 Jan 2008 22:36:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129127#M55880</guid>
      <dc:creator>Thomas Ritter</dc:creator>
      <dc:date>2008-01-14T22:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129128#M55881</link>
      <description>&amp;gt; So, how do we get SFTP to transfer the&lt;BR /&gt;&amp;gt; correct number of bytes in the file [...]?&lt;BR /&gt;&lt;BR /&gt;Complain to HP?&lt;BR /&gt;&lt;BR /&gt;If it's not too much trouble, you might try&lt;BR /&gt;using Zip on the VMS side, and UnZip (of some&lt;BR /&gt;sort) on the Windows side.  I don't guarantee&lt;BR /&gt;that it will work, but it should hide the&lt;BR /&gt;actual record attributes from SFTP.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; One thing we tried was setting RFM:UDF, and&lt;BR /&gt;&amp;gt; this seems to work with SFTP, but now the&lt;BR /&gt;&amp;gt; OpenVMS tools don't work&lt;BR /&gt;&lt;BR /&gt;What are "the OpenVMS tools" which don't&lt;BR /&gt;work?&lt;BR /&gt;&lt;BR /&gt;Of course, the Zip scheme is probably more&lt;BR /&gt;work than setting the file attributes, doing&lt;BR /&gt;the SFTP, and resetting them.</description>
      <pubDate>Mon, 14 Jan 2008 22:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129128#M55881</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-01-14T22:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129129#M55882</link>
      <description>As you've said, RFM:FIXED 512 and FFB are a contradiction. However, depending on what your PC is expecting, conversion to stream might not be correct, as it will insert an LF character at the end of every record.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;If the files are small enough (&amp;lt;32K), you might get away with setting the record length to the TOTAL size of the file.&lt;BR /&gt;&lt;BR /&gt;$ SET FILE/ATTR=(RFM:FIXED,MRS:total,LRL:total)&lt;BR /&gt;&lt;BR /&gt;(I can never remember if it's MRS or LRL, to set a fixed length so I just set both)&lt;BR /&gt;&lt;BR /&gt; If it's &amp;gt;23K, perhaps find a factor of the total size &amp;lt;32K and set the fixed length to that size. Of course, if it's a prime number &amp;gt;32K you're out of luck ;-)&lt;BR /&gt;&lt;BR /&gt; 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.&lt;BR /&gt;&lt;BR /&gt;BTW, on V8.3 and above it's even easier to convert:&lt;BR /&gt;&lt;BR /&gt;$ convert/fdl="RECORD; FORMAT STREAM_LF&lt;BR /&gt;" sftp_dir.tmp sftp_dir.cmd&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jan 2008 23:16:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129129#M55882</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-01-14T23:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129130#M55883</link>
      <description>Collisions!&lt;BR /&gt;&lt;BR /&gt;&amp;gt; One thing we tried was setting RFM:UDF, and&lt;BR /&gt;&amp;gt; this seems to work with SFTP, but now the&lt;BR /&gt;&amp;gt; OpenVMS tools don't work&lt;BR /&gt;&lt;BR /&gt;  OK, so you set the file to UDF, copy it, to the PC, then set it back to FIX for the OpenVMS tools?&lt;BR /&gt;&lt;BR /&gt;  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!</description>
      <pubDate>Mon, 14 Jan 2008 23:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129130#M55883</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-01-14T23:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129131#M55884</link>
      <description>This report reminds me of the odd usage that Windows had within some files.  For reasons I never figured out, Windows stored data or metadata after the claimed EOF.  Yes, data after the EOF.  And this meant that you had to store the last block (garbage or otherwise) to account for this usage.  CMS got nailed by this, IIRC.&lt;BR /&gt;&lt;BR /&gt;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.)&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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."&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Jan 2008 00:23:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129131#M55884</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-01-15T00:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129132#M55885</link>
      <description>An alternative might be to use ftp over a secure (tunnel) ssh session.</description>
      <pubDate>Tue, 15 Jan 2008 08:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129132#M55885</guid>
      <dc:creator>Pim van Velzen</dc:creator>
      <dc:date>2008-01-15T08:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129133#M55886</link>
      <description>If there is no solution for the file format or size problem, then a possible solution could be  to establish an STUNNEL for FTP: this should fulfill the requirement for encryption as well as sftp does.&lt;BR /&gt;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.</description>
      <pubDate>Tue, 15 Jan 2008 08:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129133#M55886</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2008-01-15T08:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129134#M55887</link>
      <description>To add to my previous reply:&lt;BR /&gt;STUNNEL is the software I would prefer (not knowing Windows implementations), because it can be setup permanently as a service.&lt;BR /&gt;The same can be achieved with an SSH port forwarding. The result is the same:&lt;BR /&gt;The data transfer is through FTP, so the file format/size problem is avoided.</description>
      <pubDate>Tue, 15 Jan 2008 08:51:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129134#M55887</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2008-01-15T08:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129135#M55888</link>
      <description>I just saw this on Hunter Goatley's FILESERV site when I was looking for something else.  It doesn't specifically answer your question, but it has some good info on the alternative methods to provide secure file transfer over the internet.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.process.com/tcpip/sft.pdf" target="_blank"&gt;http://www.process.com/tcpip/sft.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 16 Jan 2008 08:21:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129135#M55888</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2008-01-16T08:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP vs. SFTP behavior differences</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129136#M55889</link>
      <description>Many thanks for all the suggestions and comments.&lt;BR /&gt;&lt;BR /&gt;The situation is that the file format is fixed (an ISO standard), and it is not practical at this time to change the tools used to create and access this file on OpenVMS.  Furthermore, the remote user needing access to this file is connecting via a VPN where the firewall only allows SSH through (which is why FTP won't work).&lt;BR /&gt;&lt;BR /&gt;However, the remote user also has access to our Unix systems.  Therefore, as a workaround, they are using FTP between the OpenVMS system and the Unix system to get the file onto Unix, and are then using SFTP from the Unix system to their PC (through the VPN firewall).  Yes, I know, it's convoluted, but that's what is currently in place.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jan 2008 14:39:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-vs-sftp-behavior-differences/m-p/4129136#M55889</guid>
      <dc:creator>pcseunix</dc:creator>
      <dc:date>2008-01-16T14:39:17Z</dc:date>
    </item>
  </channel>
</rss>

