Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in accessing FTp server operating on OpenVMS OS

RadhaKrishnan_6
Occasional Visitor

Need help in accessing FTp server operating on OpenVMS OS

Hi,
I am developing an application using Visual C++(Visual Studio 2005)
This application will basically connect to a FTP server which is operation on open VMS OS ,and fetch a files from there to do some business processing.

the problem i am facing unable to traverse through folders to get the file

if the file is readily available in the root directory, i am successfull in getting the file through my application .

if it is kept inside a folder i dont know what delimiter i have to use in the program to distguish between the folder names

if at all the server is running on windows Os

I give file path as follows

MailFolder\\subfolder1\\sub_subfolder1\\desired file.txt

if I dont give this file path to the application, it looks for the file in the root directory that is MainFolder,else it will traverse through the path mentioned supplied and search the mentioned file in that path

This method of mentioning the file path is not working when i am connecting to a FTP server which is running on the vms OS

probably , what i m thinking is i am mentioning a wrong de-limiter between the folder names

if some one know the solution please let me know


Thanks n regards
Radhakrishnan
4 REPLIES
Duncan Morris
Honored Contributor

Re: Need help in accessing FTp server operating on OpenVMS OS

Hi RadhaKrishnan,

firstly, welcome to to Openvms itrc forum!

If you are sure that MailFolder is a root directory,then you should try
[MailFolder.subfolder1.sub_subfolder1]desiredfile.txt

If MailFolder is not a root directory, but the default (home) directory for the account, then try

[.MailFolder.subfolder1.sub_subfolder1]desiredfile.txt

If you were doing this interactively, then PWD would show the default directory for this account

and

cd [.MailFolder.subfolder1.sub_subfolder1]

would take you to the desired folder

Regards,

Duncan
Steven Schweda
Honored Contributor

Re: Need help in accessing FTp server operating on OpenVMS OS

Anonymous FTP or using a real user name?

> I give file path [...]

That's to _your_ application, not to the FTP
server, right? (_Two_ backslashes?)

Can I assume that by "root directory" you
mean the initial default directory for the
user? Do you ever need to get a file from
some other disk/directory, or will the file
always be under the user's home directory
(SYS$LOGIN on VMS)?

Which VMS FTP server? There are several
different ones available, and they don't all
behave exactly the same.

> [...] else it will traverse through the
> path [...]

How, exactly, does your program do this? You
could use one CWD command or multiple CWD
commands. (If one, you can use either a
natural VMS format or a UNIX format with all
the modern VMS FTP servers I've tried.)

Safest:
CWD MailFolder
CWD subfolder1
CWD sub_subfolder1
RETR desired_file.txt

Simpler (VMS-like):
CWD [.MailFolder.subfolder1.sub_subfolder1]
RETR desired_file.txt

Simpler (UNIX-like):
CWD MailFolder/subfolder1/sub_subfolder1
RETR desired_file.txt
(This one may cause complications with some
VMS FTP servers.)

Are you getting one file from one directory,
or multiple files from one directory, or
multiple files from multiple directories?

For example C code which works, try:

http://antinode.org/dec/sw/wget.html

or, probably:

http://curl.haxx.se/

(but I know less about that program).

Writing a good FTP client is not trivial. If
possible, I'd try to use an existing, working
program/library like wget or curl/libcurl.
(But I don't use Visual Anything, and I don't
know how easy that would be.)

> [...] the solution [...]

There's almost never "the solution", and
there's usually not even one best solution.
solution.
RadhaKrishnan_6
Occasional Visitor

Re: Need help in accessing FTp server operating on OpenVMS OS

Hi
Thanks for every one who has replied to my question
But i am sorry ,that i am not clear with the explanations

hope i am also not clear the way i explained you the problem, let me explain once again

first of all what i ment by root directory is
the home folder which is shown to the user when he login to a FTP server, so i dont have any problem in getting the files from this folder

let us assume that there is one more folder named SUB_FOLDER inside the HOME_FOLDER and inside that there is a File named DESIERED_FILE.txt

please help show me the way to retrive this file through an application
Steven Schweda
Honored Contributor

Re: Need help in accessing FTp server operating on OpenVMS OS

So far, you've gotten two answers. Where's
the mystery?

I asked several questions, and got no answers.
You also haven't shown what you are doing now
which doesn't work, so it's not easy to say
what you should change.

I'd probably do something like this:

#include

int status;

status = system( "wget ftp://user:pass@server/SUB_FOLDER/DESIERED_FILE.txt");

but I have wget installed on my systems.