<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Thanks Martin, I wanted to avoid 'rolling my own' as you have done. And also, I'm lazy,.... with the edtftp class I can do simple stuff like:<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // FTP 'put' this file to the backend<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftpConnection1.UploadFile(Resources.LocalFolder + "/" + name, name);<BR><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Rename the .GET to be .FET<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ftpConnection1.RenameFile(name, name.Replace(".GET", ".FET"));<BR><BR>
I have never been a fan of object orientation, but when C# and it's classes certain make me think again....<BR>
<BR><BR>&nbsp;<BR>

<HR id=stopSpelling>
<BR>
&gt; Subject: Re: [Simh] FTP client connecting to SIMH/OpenVMS?<BR>&gt; Date: Thu, 12 Jun 2008 08:52:57 +0200<BR>&gt; From: MV@PDV-SYSTEME.DE<BR>&gt; To: simh@trailing-edge.com<BR>&gt; CC: petermoreton@hotmail.co.uk<BR>&gt; <BR>&gt; Peter,<BR>&gt; <BR>&gt; &gt; I'm struggling to get a simple client program running <BR>&gt; &gt; on a PC to be able to FTP a file to/from OpenVMS 7.1 running <BR>&gt; &gt; under SIMH. The issue is simple: the Microsoft .NET 2.0 FTP <BR>&gt; &gt; class fesses-up when confronted with VMS directory names. It <BR>&gt; &gt; basically doesn't work, and Microsoft have acknowledged this <BR>&gt; &gt; as an issue.<BR>&gt; &gt; <BR>&gt; &gt; I'm just wondering if anyone else on the list has solved this <BR>&gt; &gt; problem, of how to write a simple Windows program to get <BR>&gt; &gt; files in/out of VMS, using c# / DotNet etc.<BR>&gt; <BR>&gt; No idea what the "Microsoft .NET 2.0 FTP class" looks like, but<BR>&gt; here's something I wrote that uses the WinInet FTP functions<BR>&gt; to get all files in a directory (beware of lines wrapping).<BR>&gt; <BR>&gt; HTH,<BR>&gt; Martin<BR>&gt; <BR>&gt; <BR>&gt; /*<BR>&gt; Format of FtpFindFirstFile/InternetFindNextFile is the same as an FTP DIR, that is:<BR>&gt; <BR>&gt; Ftp&gt; dir sys$manager:decw*.com<BR>&gt; <BR>&gt; Directory SYS$SYSROOT:[SYSMGR]<BR>&gt; <BR>&gt; DECW$KILLSERVER0.COM;1 No privilege for attempted operation<BR>&gt; DECW$PRIVATE_APPS_SETUP.COM;2 No privilege for attempted operation<BR>&gt; DECW$PRIVATE_APPS_SETUP.COM;1 No privilege for attempted operation<BR>&gt; <BR>&gt; Total of 3 files, 0/0 blocks<BR>&gt; <BR>&gt; Directory SYS$COMMON:[SYSMGR]<BR>&gt; <BR>&gt; DECW$CONSOLE.COM;1 3/3 29-MAR-2000 07:32:20 [FIELD,SYSTEM] (RWED,RWED,RE,RE)<BR>&gt; DECW$DEFAULT_DESKTOP.COM;1<BR>&gt; 1/3 29-JAN-2004 15:50:06 [FIELD,SYSTEM] (RWED,RWED,RE,RE)<BR>&gt; DECW$DEVICE.COM;1 56/57 1-OCT-2003 22:04:23 [FIELD,SYSTEM] (RWED,RWED,RE,RE)<BR>&gt; DECW$DEVICE_CONFIG_COMMON.COM;1<BR>&gt; 6/6 5-JAN-1994 13:08:13 [FIELD,SYSTEM] (RWED,RWED,RE,RE)<BR>&gt; ...<BR>&gt; <BR>&gt; Total of 30 files, 384/420 blocks<BR>&gt; <BR>&gt; Grand total of 2 directories, 33 files, 384/420 blocks<BR>&gt; <BR>&gt; Ftp&gt;<BR>&gt; <BR>&gt; <BR>&gt; except that blank lines are skipped.<BR>&gt; <BR>&gt; */<BR>&gt; int GetFiles(HINTERNET hConnection, LPSTR pattern) {<BR>&gt; HINTERNET hFindFile = NULL;<BR>&gt; WIN32_FIND_DATA FindFileData;<BR>&gt; int rc = ERROR_SUCCESS;<BR>&gt; char fspec[_MAX_PATH],<BR>&gt; lastspec[_MAX_PATH] = "",<BR>&gt; *p;<BR>&gt; BOOL continuation_line = FALSE;<BR>&gt; <BR>&gt; hFindFile = FtpFindFirstFile(hConnection, "*.*", &amp;FindFileData, INTERNET_FLAG_RELOAD, 0);<BR>&gt; if (! hFindFile)<BR>&gt; return(ProcessError("FindFirstFile"));<BR>&gt; <BR>&gt; do {<BR>&gt; if (verbosity &gt; 2)<BR>&gt; fprintf(stderr, " %s\n", FindFileData.cFileName);<BR>&gt; if (continuation_line) {<BR>&gt; continuation_line = FALSE;<BR>&gt; continue;<BR>&gt; }<BR>&gt; strcpy(fspec, FindFileData.cFileName);<BR>&gt; /*<BR>&gt; if (fspec[0] == ' ') // continuation line<BR>&gt; continue;<BR>&gt; */<BR>&gt; if (strncmp(fspec, "Directory ", sizeof("Directory ")) == 0) // directory line<BR>&gt; continue;<BR>&gt; if (strncmp(fspec, "Total of ", sizeof("Total of ")) == 0) // statistics line<BR>&gt; continue;<BR>&gt; if (strncmp(fspec, "Grand total of ", sizeof("Grand total of ")) == 0) // statistics line<BR>&gt; continue;<BR>&gt; if (strchr(fspec, ' ') == NULL) // no complete entry<BR>&gt; continuation_line = TRUE;<BR>&gt; _strupr(fspec);<BR>&gt; if ((p = strchr(fspec,';')) != NULL) // strip semicolon and everything after it<BR>&gt; *p = '\0';<BR>&gt; if (strcmp(fspec, lastspec) == 0) // multiple versions of the same file<BR>&gt; continue;<BR>&gt; strcpy(lastspec, fspec);<BR>&gt; if (strcmp(&amp;fspec[strlen(fspec)-4], ".DIR") == 0) // sub-directory entry<BR>&gt; continue;<BR>&gt; if (! match(pattern, fspec)) // no match?<BR>&gt; continue;<BR>&gt; <BR>&gt; if (verbosity &gt; 0)<BR>&gt; fprintf(stderr, "GETting file %s\n", fspec);<BR>&gt; <BR>&gt; if (!(opt &amp; OPT_M_NOCOPY) &amp;&amp; ! FtpGetFile(<BR>&gt; hConnection, // connection handle<BR>&gt; fspec, // remote file<BR>&gt; fspec, // local file name<BR>&gt; FALSE, // fail if exists?<BR>&gt; FILE_ATTRIBUTE_NORMAL, // CreateFile() flags<BR>&gt; FTP_TRANSFER_TYPE_ASCII // flags<BR>&gt; | INTERNET_FLAG_RELOAD,<BR>&gt; 0 // context<BR>&gt; )) {<BR>&gt; rc = ProcessError("FtpGetFile");<BR>&gt; break;<BR>&gt; }<BR>&gt; strcat(fspec, ";"); // UCX FTP DEL needs a semicolon<BR>&gt; if (!(opt &amp; OPT_M_NODELETE) &amp;&amp; ! FtpDeleteFile(hConnection, fspec)) {<BR>&gt; rc = ProcessError("FtpDeleteFile");<BR>&gt; break;<BR>&gt; }<BR>&gt; }<BR>&gt; while (InternetFindNextFile(hFindFile, &amp;FindFileData));<BR>&gt; <BR>&gt; if (rc == ERROR_SUCCESS &amp;&amp; GetLastError() != ERROR_NO_MORE_FILES)<BR>&gt; ProcessError("InternetFindNextFile");<BR>&gt; <BR>&gt; InternetCloseHandle(hFindFile);<BR>&gt; <BR>&gt; return(rc);<BR>&gt; }<BR>&gt; <BR>&gt; -- <BR>&gt; O Lord, won't you buy me | Martin Vorlaender | OpenVMS rules!<BR>&gt; an HP OS | work: mv@pdv-systeme.de<BR>&gt; its name starts with "Open" | http://vms.pdv-systeme.de/users/martinv/<BR>&gt; and ends in "VMS" ... | home: martin.vorlaender@t-online.de <BR><BR><br /><hr />Get 5GB of online storage for free! <a href='http://clk.atdmt.com/UKM/go/msnnkmgl0010000005ukm/direct/01/' target='_new'>Get it Now! </a></body>
</html>