1<html><head>
2	<title>Metakit sample code - FtpCat</title>
3</head><body bgcolor=white>
4
5<font face=Helvetica size=3>
6
7<!--begin-->
8<h2><img src="e4app.gif" alt="App Icon" border=0 align=left>
9Metakit sample code - FtpCat</h2><br clear=left>
10
11<p>This tiny application does not illustrate any new aspects fo Metakit,
12but it may be useful in its own right, especially with the CatFish application
13described hereafter. </p>
14
15<p><b>What it does</b>: FtpCat creates a catalog file of a directory tree,
16just like DisCat. In this case, however the directory listings are obtained
17from an FTP server anywhere on the network. Since FtpCat has no browse
18facility, you will have to use CatSend &amp; CatrRecv (or Dump) to examine
19the contents of the resulting catalog. </p>
20
21<p><b>What it illustrates</b>: FtpCat is a 32-bit console application,
22which is dynamically linked to both Metakit and MFC. FtpCat is a bit peculiar,
23in that it uses the FTP.EXE application which is part of Windows 95 to
24take care of all networking (after all, Metakit is not an introduction
25on how to build ftp clients). There are no ftp-related routines, nor even
26any Winsock calls, in FtpCat. There is a fair amount of tricky code in
27here to juggle two pipes which are used to control the child process (ftp.exe).
28</p>
29
30<p><b>How to use it</b>: FtpCat is very simple to use: simply call it with
31an URL as argument, and it will open an ftp connection and retrieve the
32listings of the specified directory and all its subdirectories. If you
33do not supply a second parameter, the catalog will be stored in a file
34called &quot;ftpcat.dat&quot;. As with DisCat, you can then use CatSend
35&amp; CatRecv to examine the catalog contents. </p>
36
37<p>If you're connected to Internet, you could try &quot;ftpcat ftp://ftp.winsite.com/pub/pc/win3/programr";
38(this is one the areas where new distributions of the Metakit library are
39posted). The &quot;ftp://"; prefix is optional, and you may add a &quot;user:password@&quot;
40prefix to the site to login under a specific name. This allows you to produce
41a catalog of protected areas, for example with &quot;ftpcat user:passwd@mysite.org/mydir&quot;.
42Please be aware of the fact that some sites on internet are huge, and that
43a command such as &quot;ftpcat ftp.winsite.com&quot; which uses &quot;/&quot;
44as default path may take some time to complete, depending on the speed
45of your connection. </p>
46
47<p><b>Known problems</b>: None, but there are some limitations in this
48sample application: </p>
49
50<ol>
51<li>The &quot;site:port&quot; notation is not implemented, you can only
52connect to standard ftp servers. </li>
53
54<li>This version does not commit intermediate results to file. If you cancel
55it, nothing is saved. </li>
56</ol>
57
58<p><b>Files in EXAMPLES\FTPCAT</b>: </p>
59
60<p>FTPCAT.CPP - FtpCat main program 
61<br>FTPCAT.MAK, FTPCAT.MDP - MSVC 4.2 project makefiles for Win32 </p>
62<!--end-->
63
64<center><p><hr size=1>
65||
66&nbsp; <a href="index.html" target="_top">Roadmap</a>
67&nbsp; <a href="classes.html">Class Index</a>
68&nbsp; <a href="samples.html">Sample Index</a>
69&nbsp; ||
70&nbsp; <a href="intro.html">Introduction</a>
71&nbsp; <a href="tips.html">Tips and Tricks</a>
72&nbsp; || 
73
74</center>
75</font>
76
77</body></html>
78