Dan Sugalski wrote:
>
> This is cool. Now all we need to do is teach Net::FTP about STRU VMS mode
> and we'll be set. (Anyone got the details on that by any chance?)
> 

I came across this while researching my ftp problem.  It seems that the
extra header info could easily be put to good use - just have to do a
pretty low level RMS open.  Not that I'm volunteering or anything ;)


/*
 *  This defines the STRU O VMS extension to the FTP protocol. A VMS
client
 *  is expected to send a "STRU O VMS" command to the server at startup.
 *  Normally it receives a 500 series reply, which indicates that the
 *  server does not support VMS structure files.
 *
 *  There are two other legal replies:
 *
 *  200     - Server is a VMS machine supporting STRU O VMS transfers
and
 *            wishes the client to use it by default.
 *
 *  201     - Server is a non-VMS machine supporting STRU O VMS but as
it is
 *            not a native file type, the server does not with the
client
 *            to use it by default. The client, by default, should send
 *            another STRU command to take the server out of structure
VMS.
 *
 *
 *      When transfering VMS files, the network byte stream consists of
a
 *  struct FILEATTR as defined below, followed by the bytes as read from
 *  the file using SYS$READ block i/o. The Version field of the
structure
 *  should be set to FILEATTR_VERSION and checked against FILEATTR
version
 *  when receiving the file. A mismatch is a fatal error. The Length
field
 *  of the structure should be set to sizeof(struct FILEATTR) when
 *  transmitting a file. When receiving a file, the receiver should
parse
 *  only as much of the structure as is available and as it knows how
to,
 *  but skip Length bytes to find the start of the file data. This
allows
 *  for both upward and downward compatibility.
 *
 *      Any changes to this structure must be coordinated with
 *      Kenneth Adelman <[EMAIL PROTECTED]>, to assure that all
 *      implementations are compatible.
 */

#define FILEATTR_VERSION 1

struct FILEATTR {
       unsigned int     Version;                /* Of this
structure         */
       unsigned int     Length;                 /* sizeof this
structure     */
       unsigned int     fab_l_alq;              /* allocation
quantity       */
       unsigned int     fab_l_fop;              /* file
options              */
       unsigned int     fab_l_mrn;              /* maximum record
number     */
       unsigned short   fab_w_deq;              /* default allocation
quantity */
       unsigned short   fab_w_mrs;              /* maximum record
size       */
       unsigned char    fab_b_org;              /* file
organization         */
       unsigned char    fab_b_rat;              /* record
attributes         */
       unsigned char    fab_b_rfm;              /* record
format             */
       unsigned char    fab_b_bks;              /* bucket
size               */
       unsigned char    fab_b_fsz;              /* fixed header
size         */

       unsigned char    xab_b_rfo;              /* record format and
file organization */
       unsigned short   xab_w_lrl;              /* longest record's
length   */
       unsigned char    xab_b_bkz;              /* bucket
size               */
       unsigned char    xab_b_hsz;              /* fixed length control
header size */
       unsigned short   xab_w_mrz;              /* maximun record
size       */
       unsigned short   xab_w_dxq;              /* default file
extension quantity */
       unsigned short   xab_w_gbc;              /* default global buffer
count */
       unsigned char    xab_b_atr;              /* record
attributes         */

       unsigned char    fab_b_rtv;              /* Retrieval window
size     */
       unsigned short   fab_w_bls;              /* block size for tape
*/
};

Reply via email to