以二进制模式 FTP 传输结构化文件

发布于 2024-11-01 15:59:17 字数 751 浏览 2 评论 0原文

我正在尝试将文件通过 FTP 传输到 Tandem HP/Non-Stop 环境中。使用 C 进程将记录写入文件,然后使用另一个 C 进程读取记录。

文件本身包含一些使用标准文本编辑器无法读取的记录。我认为这意味着要正确传输文件,我需要以二进制模式传输它。尝试以二进制模式传输会产生以下错误。

ftp> bin
200 Type set to I.
ftp> put SM11098
200 PORT command successful.
553 Error: Structured file transfer only allowed in Ascii mode,
ftp> ascii
200 Type set to A.
ftp> put SM11098
200 PORT command successful.
150 Opening data connection for SM11098 (10.220.98.237,4078d).
552 SM11098: Relative file record length > Maximum record length
ftp: 1576960 bytes sent in 4.08Seconds 386.70Kbytes/sec.

我尝试用谷歌搜索上述错误,但没有出现任何结果。 对我来说,结构化文件听起来像是包含结构化记录的二进制文件。这不应该以二进制模式进行 FTP 传输吗? FTP 程序强迫我使用 ASCII 模式。

第二个错误是什么原因? (即“相对文件记录长度>最大记录长度”)

I am trying to FTP a file onto a Tandem HP/Non-Stop environment. The records are written to the file using a C process which are then read using another C process.

The file itself contains some records which are not readable using a standard text editor. I figured this meant that to transfer the file correctly i needed to transfer it in Binary mode. Trying the transfer in binary mode produces the following errors.

ftp> bin
200 Type set to I.
ftp> put SM11098
200 PORT command successful.
553 Error: Structured file transfer only allowed in Ascii mode,
ftp> ascii
200 Type set to A.
ftp> put SM11098
200 PORT command successful.
150 Opening data connection for SM11098 (10.220.98.237,4078d).
552 SM11098: Relative file record length > Maximum record length
ftp: 1576960 bytes sent in 4.08Seconds 386.70Kbytes/sec.

I tried to google the above errors but nothing came up.
A structured file to me sounds like its a binary files that contain structured records. Shouldnt this be FTP'd in binary mode? The FTP program is forcing me to use ASCII mode.

What is the second error for? (i.e. "Relative file record length > Maximum record length")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

⒈起吃苦の倖褔 2024-11-08 15:59:17

您的帖子没有完全说明,但听起来您正在从 HP-NonStop FTPing 到 HP-NonStop,并且您的源文件是“结构化的”。您需要注意,在 NonStop 环境中,“结构化文件”具有特定的含义:该文件不同于 *nix 或 MS-DOS 系统上找到的一种文件(称为非结构化 NonStop 上的文件)。结构化文件不是字节数组,但具有记录边界和潜在的其他特征,其中一些特征类似于 SQL 表的特征。

FTP 通常适用于非结构化文件,但对于结构化文件,您可能需要使用额外的参数。 (FTP NonStop 扩展是 NonStop 系统软件中最糟糕的设计,对您来说很不幸。)基本上,您需要在 put 命令上的 和 参数之后使用属性,从结构化文件类型开始(即“e”、“k”或“r”)以及其他属性。这告诉 FTP 您正在传输结构化文件。您可能需要检查手册才能获得正确的语法。尽管有二进制数据,但您仍需要使用“ASCII 模式”。

(“相对文件记录长度”错误可能是由于未能进行结构化文件传输造成的。如果源文件是相对结构化文件,则使用文件类型“r”(代表相对)是合适的。)

但是,如果两个系统都是 NonStop,它们通常会使用“扩展”网络(例如通过 IP)进行联网,然后复制文件比使用 FTP 更容易。您可以使用普通的命令解释器,只需将系统名称作为普通副本或重复命令的目标文件名的一部分即可。

Your post doesn't quite say, but it sounds like you are FTPing from an HP-NonStop to an HP-NonStop, and your source file is "structured". You need to be aware that in the NonStop environment, "structured file" has a specific meaning: the file is different from the one kind of file found on *nix or MS-DOS systems (which are called unstructured files on NonStop). Structured files are not an array of bytes, but have record boundaries, and potentially other characteristics, some of which are similar to characteristics of SQL tables.

FTP works normally for unstructured files, but for structured files you'll probably need to fool with extra parameters. (FTP NonStop extensions are about the worst design found in the system software of NonStop, unfortunately for you.) Basically you need to use attributes after the and parameters on your put command, starting with the structured file type (which is "e", "k", or "r") and perhaps other attributes. That tells FTP you are transferring a structured file. You'll probably need to check the manual to get the syntax right. You'll need to use "ASCII mode" for this, despite having binary data.

(The "Relative file record length" error is probably due to failure to do a structured file transfer. Using the file type "r" (which stands for Relative) would be appropriate if your source file is a relative structured file.)

However, if both systems are NonStop, they typically would be networked using "Expand" networking (e.g. over IP), and then copying a file is easier than using FTP. You'd use your normal command interpreter and just put the system name as part of the destination file name of a normal copy or duplicate command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文