HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

Need help in accessing FTp server operating on OpenVMS OS

Occasional Visitor

Need help in accessing FTp server operating on OpenVMS OS

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
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

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


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


cd [.MailFolder.subfolder1.sub_subfolder1]

would take you to the desired folder


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

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.)

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:


or, probably:


(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.
Occasional Visitor

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

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:


int status;

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

but I have wget installed on my systems.