[Info-vax] Streaming a File on OpenVMS with Caché

Steven Schweda sms.antinode at gmail.com
Thu Jan 15 11:02:39 EST 2015


> We have both text and binary.

   Ok then.  And which ones are you transferring how?

> [...]If you're referring to the FTP client program used,
> are you saying that the FTP client (e.g. CMD, FileZilla,
> FireFTP, etc.) matters?

   If I said "FTP client program", then I probably meant
that.  It would matter if it affects the ASCII/binary choice.

> At this moment, I have a BIN file with the following
> DIR/FULL.
> [...]
> Record format:      Fixed length 512 byte records

   I don't know what "a BIN file" is, but that's what I'd
expect from a binary FTP transfer.  I'd expect to be able to
make that a Stream_LF file with a command like the following:

      set file /attributes = rfm:stmlf <file>

Does that help?

> [...] When reading the file, the CR,LF also terminates the
> record.

   So, was this a text file which was transferred in binary
FTP mode?  If it's not a text file, then why are you talking
about "CR,LF"?  If it _is_ a text file, then why use binary
FTP?  With my weak psychic powers, I still don't know what's
in these files.  Binary FTP may make sense for a text file,
if that SET ATTRIBUTES command fixes it, and that's probably
faster and easier than using CONVERT on a variable-length
record file (from an ASCII FTP transfer), but, generally,
using binary FTP for a text file on VMS is not the obvious
choice.

> If you can let me know how I'm supposed to be able to
> determine whether the file is ASCII or BIN without asking the
> person who uploaded the file, I could definitely let you
> know. Otherwise, you're assumption is as good as mine.

   I don't know what you mean by "the file is ASCII or BIN". 
If the question is whether or not a binary FTP transfer was
done, then you could run the experiment.  Around here, for
example:

pro3$ uname -a
Darwin pro3.antinode.info 14.0.0 Darwin Kernel Version
 14.0.0: Fri Sep 19 00:26:44 PDT 2014;
 root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

pro3$ ftp alp-l
Connected to alp-l.antinode.info.
220-   Antinode FTP Server.  Please be nice.
220 alp.antinode.info FTP Server (Version 5.6) Ready.
Name (alp-l:sms): 
331 Username sms requires a Password
Password: 
230 User logged in.
Remote system type is VMS.
ftp> put .bashrc bashrc.ascii
local: .bashrc remote: bashrc.ascii
229 Entering Extended Passive Mode (|||57333|)
150 Opening data connection for ALP$DKC0:[SMS]bashrc.ascii;1 (10.0.0.79,49291)
100% |***********************************|  1124       62.06 KiB/s    --:-- ETA
226 Transfer complete.
1124 bytes sent in 00:00 (8.78 KiB/s)
ftp> bin
200 TYPE set to IMAGE.
ftp> put .bashrc bashrc.bin
local: .bashrc remote: bashrc.bin
229 Entering Extended Passive Mode (|||57334|)
150 Opening data connection for ALP$DKC0:[SMS]bashrc.bin;1  (10.0.0.79,49292)
100% |***********************************|  1067       14.53 MiB/s    00:00 ETA
226 Transfer complete.
1067 bytes sent in 00:00 (9.60 KiB/s)
ftp> quit
221 Goodbye.


alp $ tcpip show version

  HP TCP/IP Services for OpenVMS Alpha Version V5.6 - ECO 5
  on a COMPAQ Professional Workstation XP1000 running OpenVMS V8.3    

alp $ write sys$output f$file_attributes( "bashrc.ascii", "rfm")
STMLF
alp $ write sys$output f$file_attributes( "bashrc.bin", "rfm")
FIX
alp $ write sys$output f$file_attributes( "bashrc.bin", "mrs")
512

alp $ show logical TCPIP$FTP_STREAMLF
   "TCPIP$FTP_STREAMLF" = "TRUE" (LNM$SYSTEM_TABLE)

   So, apparently, with TCPIP$FTP_STREAMLF defined, I get a
Stream_LF file from an ASCII FTP transfer, and a fixed-512
file from a binary FTP transfer.  If I do the following:

alp $ copy bashrc.bin bashrc.bin_attr
alp $ set file /attr = rfm: stmlf bashrc.bin_attr

then the resulting (text) file looks good to me (and to "EDIT
/TPU").  (If the lines are long, then you might also need to
fiddle with the LRL and/or MRS attributes.)

   DIFFERENCES thinks that bashrc.ascii bashrc.bin differ,
but BACKUP /COMPARE likes them:

alp $ backup /compare bashrc.ascii bashrc.bin
alp $ 

   After the attribute change, DIFFERENCES is also happy:

alp $ differences bashrc.ascii bashrc.bin_attr
Number of difference sections found: 0
Number of difference records found: 0
[...]

   I'm too lazy to try it, but I'd guess that without
TCPIP$FTP_STREAMLF defined, an ASCII FTP transfer will give
you a variable-length record file (that is, "VAR" from
f$file_attributes( your_file, "rfm")).  In that case, I'd
expect CONVERT to be able to convert it to Stream_LF (as
suggested earlier).

   But, again, I don't know if applying any of these methods
of getting a Stream_LF file from what you have actually
satisfies the application.  All I claim is that the amount of
mystery in the file attributes is managable, and that there
are ways of determining the attributes of a file, and of
getting from one set of attributes to aanother (without
corrupting the data).

   If I knew what was in these files, and how a good one
differs from a bad one, then I might be able to provide more
specific suggestions.  But I'd need some actual information
first.



More information about the Info-vax mailing list