Re: ftp problem - conversion file names (760 Views)
Reply
Visitor
lluisaunos
Posts: 3
Registered: ‎01-14-2014
Message 1 of 8 (864 Views)
Accepted Solution

ftp problem - conversion file names

Hello,

 

I have problems when I execute openvms ftp client to a ftp windows server, because it changes the filename.

 

The file I want to get from windows ftp server is named "file.seq.txt", and when a do a "ftp> get *", the file is downloaded with the name "file_seq.txt".

 

Anyone knows how to resolve it?

 

I have OpenVMS 7.3-2 and the ftp in windows is IIS, but it occurs with different versions.

 

thank you in advance,

 

Lluís Aunós

Honored Contributor
Volker Halle
Posts: 5,209
Registered: ‎04-26-2004
Message 2 of 8 (855 Views)

Re: ftp problem - conversion file names

Lluís,

 

"file.seq.txt" is not a valid OpenVMS filename, unless your default directory is on an ODS-5 disk and you have extended file name parsing enabled. FTP is trying to create a valid OpenVMS filename by replacing the first '.' with an '_'.

 

Make sure (SHOW DEVICE/FULL SYS$DISK), that the default directory is set to an ODS-5 disk and try: SET PROC/PARSE=EXTENDED before invoking FTP. The OpenVMS filename might then become "file^.seq.txt"

 

Volker.

Esteemed Contributor
H.Becker
Posts: 373
Registered: ‎04-09-2009
Message 3 of 8 (842 Views)

Re: ftp problem - conversion file names

>>> the file is downloaded with the name "file_seq.txt".

 

It's not obvious whether this is ODS-2 or already ODS-5. If the filename really is in lowercase, it is already ODS-5, otherwise it would be "FILE_SEQ.TXT". But, maybe the poster only wanted to say that the first dot was converted to an underscore. But who knows what he wanted to say. If it is already ODS-5 then the FTP client converts. Then there should be some documentation on the FTP client what to set/enable to leave the dots in the filename.

 

>>> try: SET PROC/PARSE=EXTENDED

 

I don't think that this is required, but it doesn't hurt, either.

 

>>> filename might then become "file^.seq.txt"

 

 No. The filename will be "file.seq.txt" it might be displayed differently, with the escape character '^', but that is only for displaying the filename. In this case the '^' isn't even necessary to access the file. (But if you want to use the displayed filename with the escape character you need to have extended parsing enabled.) 

Honored Contributor
Steven Schweda
Posts: 9,096
Registered: ‎02-23-2005
Message 4 of 8 (838 Views)

Re: ftp problem - conversion file names

Visitor
lluisaunos
Posts: 3
Registered: ‎01-14-2014
Message 5 of 8 (823 Views)

Re: ftp problem - conversion file names

Hi,

 

thank you for your replies.

 

That's all right, the problem is that the ftp destination disk is ODS-2. We'll search for a disk ODS-5 to be able to be destination of these files. On the other hand, I don't know if the extra character '^' is a inconvenient for our process, maybe we'll need to change de code of the script that does the ftp to delete this extra character, I think it will not be a problem.

 

Regards,

 

Lluís

Honored Contributor
Steven Schweda
Posts: 9,096
Registered: ‎02-23-2005
Message 6 of 8 (805 Views)

Re: ftp problem - conversion file names

Visitor
lluisaunos
Posts: 3
Registered: ‎01-14-2014
Message 7 of 8 (760 Views)

Re: ftp problem - conversion file names

$ tcpip show version

 

  HP TCP/IP Services for OpenVMS Alpha Version V5.4
  on a AlphaServer DS25 running OpenVMS V7.3-2


My script uses the ftp client to connect a Windows server, download files and delete from the source. Pseudo-code:

1) create temporary directory (vms)
    crea/dir 'tmp'
    cd 'tmp'
2) download files
    ftp 'windows server'
    ftp> get *
3) delete files from the windows server
    "prepare delete ftp commands listing 'tmp' dir"
    ftp 'windows server' with the delete commands before prepared

I've been testing a new tmp directory with a device ODS-5, and it is ok, but with the '^' character added. No problem, we have changed the <prepare delete ftp commands listing 'tmp' dir> code to clean any '^' and it is right for our purpose.

thank you,

Lluís

Esteemed Contributor
H.Becker
Posts: 373
Registered: ‎04-09-2009
Message 8 of 8 (755 Views)

Re: ftp problem - conversion file names

Which means you get the file names displayed by a DIR command, by the lexical function F$SEARCH or any other tool which displays the escape character. And you take that output to construct a script for deleting files on the remote side. As said before, the REAL file name on ODS-5 doesn't contain the escape character '^', but DIR and F$SEARCH show it. So you have to remove it when writing the script based on such output.  (You probably considered the case when the remote file name contains a '^'. :-)

 

DEMO$ sh sys/noproc/full
OpenVMS V8.4  on node JACK   17-JAN-2014 09:30:00.18   Uptime  6 03:32:11
        HP rx2600  (1.50GHz/6.0MB)
DEMO$
DEMO$ pipe sh dev/full sys$disk: |search sys$pipe ods
  Volume Status:  ODS-5, subject to mount verification, file high-water marking,
DEMO$ 
DEMO$ sh proc/pars
 
17-JAN-2014 09:24:56.64   User: DEMO             Process ID:   20200F92
                          Node: JACK             Process name: "DEMO"
 
Parse Style: Traditional
DEMO$
 
DEMO$ copy nl: a.b.c
DEMO$
DEMO$ dir/file a.b.c
 
Directory LDA11:[X]
              
A^.B.C;1             (16,1,0)              
 
Total of 1 file.
DEMO$
DEMO$ write sys$output f$search("a.b.c")
LDA11:[X]A^.B.C;1
DEMO$ 
DEMO$ pipe dump/header a.b.c |search sys$pipe "file name"
    File name type:                       ISL-1
    File name length:                     7
    File name:                            A.B.C;1
DEMO$ 
 
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.