Re: System.Net.FTP and VMS
- From: AndersGson <AndersGson@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 02:33:10 -0700
Hi, I have the same problem. Can you remove the final "/" that FTPWebRequest
adds to it's CWD-command?
/Anders
"Arne Vajhøj" wrote:
Mark Rae wrote:.
Has anyone successfully used the FTP stuff in the System.Net namespace
against a VMS FTP server?
I'm trying to do this at the moment and can't even get a directory listing,
although there are no problems using the Chilkat FTP component, or
connecting and browsing manually with a variety of FTP clients.
The code I'm using is:
FtpWebRequest objFTPRequest = (FtpWebRequest)WebRequest.Create("ftp://" +
CGlobal.gstrFTPServer);
objFTPRequest.Credentials = new NetworkCredential(CGlobal.gstrFTPUsername,
CGlobal.gstrFTPPassword);
objFTPRequest.UseBinary = false;
objFTPRequest.UsePassive = true;
objFTPRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FtpWebResponse objFTPResponse = (FtpWebResponse)objFTPRequest.GetResponse();
Stream objResponseStream = objFTPResponse.GetResponseStream();
StreamReader objReader = new StreamReader(objResponseStream);
string strFiles = objReader.ReadToEnd();
This fails on the GetResponse() line with the following error:
{"The remote server returned an error: (550) File unavailable (e.g., file
not found, no access)."}
[System.Net.WebException]: {"The remote server returned an error:
(550) File unavailable (e.g., file not found, no access)."}
The above code returns a directory listing perfectly when connecting to a
Windows FTP server or a Linux FTP server. However, it seems to have an issue
with VMS.
I'm wondering if it's because the particular VMS operating system allows for
duplicate filenames differentiated by a numerical suffix e.g.
BROKER.CUS;1
BROKER.CUS;2
BROKER.CUS;3
BROKER.CUS;4
No what happend is:
client->server: PWD
server->client: disk:[dir]
client->server: CWD disk:[dir]/
The .NET FTP client apperently only works with servers that
uses / as directory separator (yes - Windows FTP servers
usually emulates that).
I will require some coding to workaround that.
Arne
- Follow-Ups:
- Re: System.Net.FTP and VMS
- From: Arne Vajhøj
- Re: System.Net.FTP and VMS
- References:
- System.Net.FTP and VMS
- From: Mark Rae
- Re: System.Net.FTP and VMS
- From: Arne Vajhøj
- System.Net.FTP and VMS
- Prev by Date: Re: More Efficient: Hashtable or List
- Next by Date: Re: system.configuration.provider
- Previous by thread: Re: System.Net.FTP and VMS
- Next by thread: Re: System.Net.FTP and VMS
- Index(es):
Relevant Pages
|