Re: System.Net.FTP and VMS

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.



Relevant Pages

  • Re: FTP - Get size of a file
    ... } FTP server running on OpenVMS. ... I have no clue about VMS at all. ... and unzip -t it on the receiver. ... 200 PORT command successful. ...
    (comp.os.vms)
  • Re: FTP - Get size of a file
    ... I wrote a Windows service to do exactly this for a major utility a ... FTP it is difficult to implement more advanced techniques such as CRC ... >} FTP server running on OpenVMS. ... I have no clue about VMS at all. ...
    (comp.os.vms)
  • Re: DECnet hacker?
    ... One thing about VMS, it never shows passwords, to ... I think it is pretty unlikely that anyone would have a username ... However, I think it is the job of the FTP server, not the security ... to record email addresses for anonymous logins. ...
    (comp.os.vms)
  • FTP - Get size of a file
    ... FTP server running on OpenVMS. ... I have no clue about VMS at all. ... we had problems with transfering files from this server to a ... Is there a command like 'SIZE ' on the ...
    (comp.os.vms)
  • Re: FTP - Get size of a file
    ... > FTP server running on OpenVMS. ... I have no clue about VMS at all. ... we had problems with transfering files from this server to a ...
    (comp.os.vms)