Mercurial > hg > xemacs-beta
comparison man/ange-ftp.texi @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | ac2d302a0011 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
1 \input texinfo @c -*-texinfo-*- | |
2 @comment %**start of header (This is for running Texinfo on a region.) | |
3 @setfilename ../info/ange-ftp.info | |
4 @settitle ange-ftp | |
5 @comment %**end of header (This is for running Texinfo on a region.) | |
6 | |
7 @synindex pg vr | |
8 | |
9 @node Top, What is ange-ftp?, (dir), (dir) | |
10 @comment node-name, next, previous, up | |
11 @ifinfo | |
12 @unnumbered Ange-ftp | |
13 | |
14 This file documents ange-ftp, a system for transparent file-transfer | |
15 between remote hosts using the FTP protocol within GNU Emacs. | |
16 | |
17 This info is current to Version 4.2 of Ange-ftp. | |
18 | |
19 Documentation version: 1.32 | |
20 | |
21 Copyright @copyright{} 1991, 1992 Free Software Foundation, Inc. | |
22 | |
23 Permission is granted to make and distribute verbatim copies of | |
24 this manual provided the copyright notice and this permission notice | |
25 are preserved on all copies. | |
26 | |
27 @ignore | |
28 Permission is granted to process this file through TeX and print the | |
29 results, provided the printed document carries a copying permission | |
30 notice identical to this one except for the removal of this paragraph | |
31 (this paragraph not being relevant to the printed manual). | |
32 | |
33 @end ignore | |
34 Permission is granted to copy and distribute modified versions of this | |
35 manual under the conditions for verbatim copying, provided that the | |
36 entire resulting derived work is distributed under the terms of a | |
37 permission notice identical to this one. | |
38 @end ifinfo | |
39 | |
40 @titlepage | |
41 @sp5 | |
42 @center @titlefont{ange-ftp} | |
43 @center version 4.2 | |
44 @sp2 | |
45 @center A transparent remote file system, by Andy Norman | |
46 @sp7 | |
47 @center This documentation by David Smith. | |
48 @center info-version 1.32 | |
49 @page | |
50 @vskip 0pt plus 1filll | |
51 Copyright @copyright{} 1991, 1992 Free Software Foundation, Inc. | |
52 | |
53 Permission is granted to make and distribute verbatim copies of | |
54 this manual provided the copyright notice and this permission notice | |
55 are preserved on all copies. | |
56 | |
57 Permission is granted to copy and distribute modified versions of this | |
58 manual under the conditions for verbatim copying, provided that the | |
59 entire resulting derived work is distributed under the terms of a | |
60 permission notice identical to this one. | |
61 @end titlepage | |
62 | |
63 @menu | |
64 * What is ange-ftp?:: A brief introduction to ange-ftp. Credits. | |
65 * Installing ange-ftp:: Where to find it, and how to use it. | |
66 * Using ange-ftp:: Ange-ftp -- a users' guide. | |
67 * Getting help:: Mailing lists and newsgroups. | |
68 * Bugs:: Known bugs, and a wish list. | |
69 | |
70 Indices: | |
71 * Concept Index:: | |
72 * Variable and command index:: | |
73 @end menu | |
74 | |
75 | |
76 @node What is ange-ftp?, Installing ange-ftp, Top, Top | |
77 @comment node-name, next, previous, up | |
78 @chapter Introducing ange-ftp. | |
79 | |
80 Ange-ftp is a system for transparent file-transfer between remote UNIX, | |
81 VMS, CMS or MTS | |
82 hosts using FTP. This means that you can edit, copy and otherwise | |
83 manipulate files on any machine you have access to from within GNU Emacs | |
84 as if it were a local file. Ange-ftp works by introducing an extended | |
85 filename syntax, and overloading functions such as | |
86 @code{insert-file-contents} so that accessing a remote file causes | |
87 appropriate commands to be sent to an FTP process. Ange-ftp works with | |
88 Dired (and in particular Sebastian Kremer's Tree Dired) to facilitate | |
89 directory browsing and multiple file transfer from remote hosts. | |
90 | |
91 The author of ange-ftp is Andy (Ange) Norman (@code{ange@@hplb.hpl.hp.com}). | |
92 @ifinfo | |
93 Many people have sent in enhancements, and Ange has been kept quite | |
94 busy testing them and incorporating them into ange-ftp. Current members | |
95 of the Ange-Ftp Hall of Fame include: | |
96 | |
97 @itemize @bullet | |
98 @item | |
99 Many thanks to Roland McGrath for improving the filename syntax handling, | |
100 for suggesting many enhancements and for numerous cleanups to the code. | |
101 | |
102 @item | |
103 Thanks to Jamie Zawinski for bugfixes and for ideas such as gateways. | |
104 | |
105 @item | |
106 Thanks to Ken Laprade for improved @file{.netrc} parsing and password | |
107 reading, and Dired/shell autoloading. | |
108 | |
109 @item | |
110 Thanks to Sebastian Kremer for tree dired support and for many ideas and | |
111 bugfixes. | |
112 | |
113 @item | |
114 Thanks to Joe Wells for bugfixes, non-UNIX system support, VOS support, | |
115 and hostname completion. | |
116 | |
117 @item | |
118 Thanks to Nakagawa Takayuki for many good ideas, filename-completion, help | |
119 with file-name expansion, efficiency worries, stylistic concerns and many | |
120 bugfixes. | |
121 | |
122 @item | |
123 Thanks to Sandy Rutherford who re-wrote most of ange-ftp to support VMS, | |
124 MTS, CMS and UNIX-dls. Sandy also added dired-support for non-UNIX OS and | |
125 auto-recognition of the host type. | |
126 | |
127 @item | |
128 Also, thanks to Keith Waclena, Mark D. Baushke, Terence Kelleher, | |
129 Ping Zhou, Edward Vielmetti, Jack Repenning, Mike Balenger, Todd | |
130 Kaufmann, Kjetil Svarstad, Tom Wurgler, Linus Tolke, Niko Makila, Carl | |
131 Edman, Bill Trost, Dave Brennan, Dan Jacobson, Andy Scott, Steve | |
132 Anderson, Sanjay Mathur, the folks on the ange-ftp-lovers mailing list | |
133 and many others whose names have been forgotten who have helped to debug | |
134 and fix problems with @file{ange-ftp.el}. | |
135 @end itemize | |
136 @end ifinfo | |
137 | |
138 Finally, this info file was written by Dave Smith | |
139 (@code{dsmith@@stats.adelaide.edu.au}), although large chunks of it | |
140 @ifinfo | |
141 @noindent | |
142 (such as most of this node :-) | |
143 @end ifinfo | |
144 @noindent | |
145 are plagiarised straight out of the extensive | |
146 comments section of @file{ange-ftp.el}. | |
147 | |
148 @node Installing ange-ftp, Using ange-ftp, What is ange-ftp?, Top | |
149 @comment node-name, next, previous, up | |
150 @chapter Installing ange-ftp | |
151 | |
152 If you don't already have a copy of ange-ftp, or you want a later | |
153 version, ange-ftp is pretty easy to get hold of. FTP is the probably the | |
154 simplest method, but other options such as mail are available. | |
155 | |
156 Once you have the Emacs-Lisp source, there are a few customisations you | |
157 might need to make. The ideal configuration is to have the FTP process running | |
158 on the same machine as you are running Emacs on, but this is not always | |
159 possible since some machines cannot access hosts outside the local | |
160 network. In this case, the FTP process needs to be run on a machine | |
161 which @emph{does} have access to the local world --- this is called the | |
162 @strong{gateway host}. Ange-ftp has facilities to make use of a | |
163 gateway host when accessing remote hosts. | |
164 | |
165 @menu | |
166 * Obtaining source code:: Where to find the ange-ftp source. | |
167 * Installing source:: Where to put it, how to load it. | |
168 * Using a gateway:: For when your local machine has limited access. | |
169 * Other options:: More user variables to twiddle. | |
170 @end menu | |
171 | |
172 @node Obtaining source code, Installing source, ,Installing ange-ftp | |
173 @section How to get the ange-ftp source code | |
174 @comment node-name, next, previous, up | |
175 | |
176 The latest version of ange-ftp should always be available for anonymous | |
177 FTP from | |
178 @example | |
179 alpha.gnu.ai.mit.edu | |
180 @end example | |
181 @noindent | |
182 in the file | |
183 @example | |
184 ange-ftp/ange-ftp.tar.Z | |
185 @end example | |
186 @noindent | |
187 (which includes both @file{ange-ftp.el} and this texinfo file.) In ange-ftp | |
188 notation, that's | |
189 @example | |
190 /anonymous@@alpha.gnu.ai.mit.edu:ange-ftp/ange-ftp.tar.Z | |
191 @end example | |
192 | |
193 Alternatively, ange-ftp is also part of the Emacs-Lisp Archive | |
194 @cindex Emacs-Lisp Archive | |
195 on | |
196 @code{archive.cis.ohio-state.edu}. The latest version should always be | |
197 available on this site, but the Lisp-Code Directory entry is not always | |
198 up to date; it currently reads: | |
199 @example | |
200 ange-ftp (3.112) 91-08-12 | |
201 Andy Norman, <ange@@hplb.hpl.hp.com> | |
202 archive.cis.ohio-state.edu: | |
203 /pub/gnu/emacs/elisp-archive/as-is/ange-ftp.el.Z | |
204 transparent FTP Support for GNU Emacs | |
205 @end example | |
206 | |
207 Ange-ftp can also be found at: | |
208 @example | |
209 ugle.unit.no:/pub/gnu/emacs-lisp/ange-ftp.el.Z | |
210 @end example | |
211 | |
212 Failing these, someone on the ange-ftp mailing list (@xref{Getting | |
213 help}) or the author himself (@xref{What is ange-ftp?}) may be able to | |
214 help you find the latest version. | |
215 | |
216 If you intend to do a lot of browsing though archive sites it is | |
217 definitely worth your while installing Sebastian Kremer's Tree Dired | |
218 @cindex Tree Dired, source | |
219 along with ange-ftp (if you haven't done it already). Tree Dired will | |
220 work with ange-ftp without any modifications: all you need to do is | |
221 follow the installation instructions that come with the package. The | |
222 Tree Dired package comes complete with the latest version of ange-ftp, | |
223 and is available for anonymous FTP from the following sites: | |
224 @example | |
225 ftp.thp.Uni-Koeln.DE:/pub/gnu/emacs/diredall.tar.Z (134.95.64.1) | |
226 ftp.cs.buffalo.edu:pub/Emacs/diredall.tar.Z | |
227 @end example | |
228 @noindent | |
229 Alternatively, you can get in touch with Sebastian himself | |
230 using his e-mail address: @code{sk@@thp.Uni-Koeln.DE}. | |
231 | |
232 @node Installing source, Using a gateway, Obtaining source code, Installing ange-ftp | |
233 @comment node-name, next, previous, up | |
234 @section Installing the source | |
235 | |
236 Installation is simply a matter of copying the file @file{ange-ftp.el} | |
237 to a directory in your load-path. If you don't already have a load-path, | |
238 this is probably a good time to make one. Just create a directory (say, | |
239 @file{~/elisp}) in which you plan to keep your Emacs-Lisp files. Then | |
240 place the following line in your @file{.emacs}: | |
241 @example | |
242 (setq load-path (cons (expand-file-name "~/elisp") load-path)) | |
243 @end example | |
244 @cindex load path | |
245 @noindent | |
246 The @code{expand-file-name} is @emph{important} --- omitting it is a | |
247 common reason why load-paths do not work. | |
248 | |
249 Once you've copied @file{ange-ftp.el} to the appropriate directory, it is | |
250 recommended to byte-compile it, with @kbd{M-x byte-compile-file}. Then | |
251 place the line | |
252 @example | |
253 (require 'ange-ftp) | |
254 @end example | |
255 @noindent | |
256 in your @file{.emacs} (@emph{after} the line which modifies your | |
257 load-path, of course!) It's that simple. | |
258 | |
259 The above instructions should allow you to access all hosts that your | |
260 local machine can access. If your local host has limited access, | |
261 however, you may wish to have ange-ftp working through a gateway | |
262 machine. If so, read on. Otherwise, @xref{Using ange-ftp} to get started | |
263 using ange-ftp. | |
264 | |
265 @node Using a gateway, Other options, Installing source, Installing ange-ftp | |
266 @comment node-name, next, previous, up | |
267 @section Using a gateway | |
268 | |
269 Suppose you are running Emacs (and ange-ftp, of course) on a machine X | |
270 (let's call it the `local host') and you want to access a file on a | |
271 machine Z (which we will call the `remote host'). Unfortunately, X does | |
272 not have FTP access to Z: when you try a manual FTP something like | |
273 the following happens: | |
274 @example | |
275 X$ ftp Z.foo.bar.com | |
276 ftp: connect: Host is unreachable | |
277 @end example | |
278 @noindent | |
279 However, X @emph{does} have access to a machine Y (the `gateway | |
280 machine') which @emph{can} access Z. Fortunately, you have an account on | |
281 the gateway machine, and so the solution is to login to Y, ftp to Z, | |
282 download the file you want from Z to Y, and then copy it from Y to the | |
283 local host, X. This can get a bit tedious, to say the least, but | |
284 fortunately ange-ftp can do all the hard work for you. | |
285 | |
286 Firstly, you need to set the variable @code{ange-ftp-gateway-host} to | |
287 the name of the gateway machine. The name should be the one that the | |
288 local host recognises, that is, the name you use with @code{login} so | |
289 that it works. | |
290 @example | |
291 (setq ange-ftp-gateway-host "Y.local.lan.edu") | |
292 @end example | |
293 @vindex ange-ftp-gateway-host | |
294 @noindent | |
295 Since you only need to go through these convolutions for remote hosts | |
296 that the local host can't access directly, you can set the variable | |
297 @code{ange-ftp-local-host-regexp} to a regular expression which matches | |
298 those hostnames that X can access, but does not match those hosts that | |
299 only the gateway can access. In other words, if the host you are trying | |
300 to access matches @code{ange-ftp-local-host-regexp}, the FTP process | |
301 will be run on the local machine, otherwise it will be run on the | |
302 gateway machine. For example | |
303 @example | |
304 (setq ange-ftp-local-host-regexp "\\.hp\\.com$\\|^[^.]*$") | |
305 @end example | |
306 @vindex ange-ftp-local-host-regexp | |
307 @noindent | |
308 will match all hosts that are in the @samp{.hp.com} domain, or don't have an | |
309 explicit domain in their name, but will fail to match hosts with | |
310 explicit domains or that are specified by their IP address. | |
311 | |
312 The next step is to determine whether you have a smart gateway, that is, | |
313 @cindex smart gateways | |
314 if the FTP process on the gateway will accept commands of the form | |
315 @code{USER user@@host}. You can test this by trying a manual FTP: | |
316 @example | |
317 X$ ftp -n Y.local.lan.edu | |
318 Connected to Y.local.lan.edu | |
319 220 Y.local.lan.edu FTP server (Version ?.??? some-date) ready. | |
320 ftp> user myname@@Z.foo.bar.com | |
321 @end example | |
322 @noindent | |
323 If you then got a message like: | |
324 @example | |
325 331 Password required for myname@@Z.foo.bar.com | |
326 Password: | |
327 530 Login incorrect. | |
328 Login failed. | |
329 @end example | |
330 @noindent | |
331 then you @emph{don't} have a smart gateway. If you do, then something | |
332 else happens -- but since it doesn't work for me I can't say what! | |
333 Anyway, if you do have a smart gateway, put the line | |
334 @example | |
335 (setq ange-ftp-smart-gateway t) | |
336 @end example | |
337 @vindex ange-ftp-smart-gateway | |
338 @noindent | |
339 in your @file{.emacs}. You may also wish to set the variable | |
340 @code{ange-ftp-smart-gateway-port} | |
341 @vindex ange-ftp-smart-gateway-port | |
342 to the port of the gateway machine to | |
343 use when smart gateway is in operation, but the default of 21 will | |
344 probably be fine. In any case, your installation has finished, so | |
345 @xref{Using ange-ftp} now -- the rest of this section is of no use to | |
346 you. If on the other hand you don't have a smart gateway, put the line | |
347 @example | |
348 (setq ange-ftp-smart-gateway nil) ; this is the default | |
349 @end example | |
350 @noindent | |
351 in your @file{.emacs} and read on. | |
352 | |
353 Since to get files from Z to X we need to copy from Z to Y, and then | |
354 from Y to X, we need a place to store files on Y which is also | |
355 accessible by X, i.e. we need a directory which is mounted on both X and | |
356 Y. Since we are assuming that the local host and the gateway machine are | |
357 on the same local network, it's fairly likely that this is the case | |
358 thanks to NFS. | |
359 @cindex NFS | |
360 If such a directory exists, then ange-ftp can transfer files from Z to X | |
361 simply by FTP'ing from Z to the temporary directory on Y, and then using | |
362 a normal (local) copy from the image of the temporary directory on X to | |
363 the destination directory. Unfortunately, ange-ftp requires that | |
364 this temporary directory | |
365 @cindex temporary files | |
366 has the @emph{same} name on both the local and | |
367 gateway machines, so you might need to do some twiddling with symbolic | |
368 links, or ask your sysadmin to set something up with NFS. Once you have | |
369 found such a directory, set the variable | |
370 @code{ange-ftp-gateway-tmp-name-template} | |
371 to the name of this directory plus an identifying filename prefix. For example: | |
372 @example | |
373 (setq ange-ftp-gateway-tmp-name-template "/nfs/hplose/ange/ange-ftp") | |
374 @end example | |
375 @vindex ange-ftp-gateway-tmp-name-template | |
376 @noindent | |
377 where @file{/nfs/hplose/ange} is a directory that is shared between the gateway | |
378 machine Y and the local machine X. | |
379 | |
380 The next step is to find a means of getting an FTP process running on | |
381 the gateway machine. The simplest method is to spawn a remote shell | |
382 @cindex remote shell | |
383 using @code{remsh} or @code{rsh} or their equivalent. Unfortunately, this | |
384 doesn't always work --- try the following: | |
385 @example | |
386 X$ rsh Y.local.lan.edu ftp | |
387 @end example | |
388 @noindent | |
389 On my system, this command simply hangs. On others, it might be | |
390 disallowed for security reasons. If it doesn't work for you, then skip | |
391 the rest of this paragraph. If it does, then you should set then | |
392 variable @code{ange-ftp-gateway-program} to the name of the program | |
393 used to spawn a remote shell. The default is @code{"remsh"} | |
394 on HP-UX machines, and @code{"rsh"} otherwise. You should also set | |
395 @code{ange-ftp-gateway-program-interactive} to @code{nil}: | |
396 @example | |
397 (setq ange-ftp-gateway-program "rsh") | |
398 (setq ange-ftp-gateway-program-interactive nil) | |
399 @end example | |
400 @vindex ange-ftp-gateway-program | |
401 @vindex ange-ftp-gateway-program-interactive | |
402 @noindent | |
403 and now your installation is complete. | |
404 | |
405 Since spawning a remote shell didn't work, ange-ftp needs to actually | |
406 login to the gateway machine to run ftp, the same as you would do if you | |
407 were running ftp manually. So you need to set the variable | |
408 @code{ange-ftp-gateway-program} to the name of the program that lets you | |
409 log onto the gateway machine --- probably @code{"rlogin"} or @code{"telnet"}: | |
410 @example | |
411 (setq ange-ftp-gateway-program "rlogin") | |
412 @end example | |
413 @noindent | |
414 Now set the variable @code{ange-ftp-gateway-prompt-pattern} to a regular | |
415 expression that matches the prompt you get when you login to the gateway | |
416 machine. Be very specific here; this regexp must not match | |
417 @emph{anything} in your login banner except this prompt. | |
418 @code{shell-prompt-pattern} | |
419 @vindex shell-prompt-pattern | |
420 is far too general as it appears to match | |
421 some login banners from Sun machines. For example: | |
422 @example | |
423 (setq ange-ftp-gateway-prompt-pattern "^[^$]*\\$ *") | |
424 @end example | |
425 @vindex ange-ftp-gateway-prompt-pattern | |
426 @noindent | |
427 You also need to set the variable | |
428 @code{ange-ftp-gateway-program-interactive} | |
429 to @code{t} to let ange-ftp know that it has to "hand-hold" the login to | |
430 the gateway machine: | |
431 @example | |
432 (setq ange-ftp-gateway-program-interactive t) | |
433 @end example | |
434 @noindent | |
435 Now comes a slightly tricky bit. You need to set the variable | |
436 @code{ange-ftp-gateway-setup-term-command} to a UNIX command that will | |
437 put the pty connected to the gateway machine into a no-echoing mode, and | |
438 will strip off carriage-returns from output from the gateway machine. | |
439 The default is @code{"stty -onlcr -echo\n"} for HP-UX machines, and | |
440 @cindex HP-UX | |
441 @code{"stty -echo nl\n"} otherwise. So | |
442 @example | |
443 (setq ange-ftp-gateway-setup-term-command "stty -echo nl\n") | |
444 @end example | |
445 @vindex ange-ftp-gateway-setup-term-command | |
446 @noindent | |
447 will probably work. If it does, then you're done. There's a bit of a | |
448 problem for @code{tcsh} | |
449 @cindex tcsh | |
450 users, though: in some versions of @code{tcsh}, the "tty | |
451 sanity checking" feature prevents the above commands from working. In | |
452 this case, an easy fix is to invoke @code{csh} first, and then run the | |
453 @code{stty}: | |
454 @example | |
455 (setq ange-ftp-gateway-setup-term-command "exec csh\nstty -echo nl\n") | |
456 @end example | |
457 or maybe | |
458 @example | |
459 (setq ange-ftp-gateway-setup-term-command "(stty -echo nl; csh)\n") | |
460 @end example | |
461 @noindent | |
462 may well do the trick. When using this method, synchronisation may be a | |
463 problem: if your gateway machine is slow in responding, when ange-ftp is | |
464 ready for (and indeed has already sent) FTP commands, your machine may | |
465 still be setting up. This can cause ange-ftp to think that the FTP has | |
466 had an error, and abort. One solution is to set | |
467 @code{ange-ftp-skip-msgs} | |
468 @vindex ange-ftp-skip-msgs | |
469 (a regular expression matching messages from the ftp process that can be | |
470 ignored) so that any line ending in @code{^M} (carriage-returns) will be | |
471 ignored (since the @code{stty} hasn't come into effect yet) and also to | |
472 ignore any lines beginning with your prompt (since this means the | |
473 terminal setup is still in progress): | |
474 @example | |
475 (setq ange-ftp-skip-msgs | |
476 (concat "\\|^.*\C-M$\\|" ange-ftp-gateway-prompt-pattern | |
477 ange-ftp-skip-msgs)) | |
478 @end example | |
479 @noindent | |
480 Unfortunately, this can also mean that sometimes ange-ftp won't | |
481 recognise a @emph{real} error, and simply hang -- but if that ever | |
482 happens @kbd{C-g} might get you out of it. | |
483 | |
484 @node Other options, , Using a gateway, Installing ange-ftp | |
485 @comment node-name, next, previous, up | |
486 @section Other user options | |
487 | |
488 Here are the other user options available in ange-ftp: | |
489 | |
490 @code{ange-ftp-netrc-filename}: The name of a file in @code{netrc(5)} | |
491 format that ange-ftp will use to match hostnames, users and their | |
492 respective passwords. Hostnames specified here are also used for hostname | |
493 completion. | |
494 The default is @code{"~/.netrc"}. | |
495 @vindex ange-ftp-netrc-filename | |
496 | |
497 @code{ange-ftp-default-user}: If this is a string, it is the username to | |
498 use when none is specified in a filename. If @code{nil}, then the | |
499 name under which the user is logged in is used. If non-@code{nil} but | |
500 not a string, the user is prompted for the name. The default is @code{nil}. | |
501 @vindex ange-ftp-default-user | |
502 | |
503 @code{ange-ftp-default-password}: The password to use when the user is the | |
504 same as @code{ange-ftp-default-user}. The default is @code{nil}. | |
505 @vindex ange-ftp-default-password | |
506 | |
507 @code{ange-ftp-default-account}: Account password to use when the user | |
508 is the same as @code{ange-ftp-default-user}. The default is @code{nil}. | |
509 @vindex ange-ftp-default-account | |
510 | |
511 @code{ange-ftp-generate-anonymous-password}: If this is @code{t}, then | |
512 ange-ftp will generate a password of the form @code{your_username@@local_host} | |
513 when you specify a username of @code{anonymous} in the filename (or if | |
514 you are automatically logged in as @code{anonymous}). If this is a | |
515 string, then that string is used instead. If it is @code{nil}, then the | |
516 user is prompted for a password. The default is @code{nil}. | |
517 @vindex ange-ftp-generate-anonymous-password | |
518 | |
519 @code{ange-ftp-dumb-unix-host-regexp}: The FTP servers on some machines have | |
520 problems if the @code{ls} command is used. The usual indication that | |
521 something is wrong is when ange-ftp erroneously thinks that a directory | |
522 is just a plain file. The routine @code{ange-ftp-add-dumb-unix-host} can can | |
523 be called to tell ange-ftp to limit itself to the @code{DIR} command and | |
524 not @code{ls} for a given host (but this change will take effect for the | |
525 current GNU Emacs session only). If a large number of machines with | |
526 similar hostnames have this problem then it is easier to change the | |
527 value of this variable to a regexp which matches hostnames which have | |
528 this problem, particularly since ange-ftp cannot automatically detect | |
529 such hosts. The default is @code{nil}. | |
530 @vindex ange-ftp-dumb-unix-host-regexp | |
531 @pindex ange-ftp-add-dumb-unix-host | |
532 | |
533 @code{ange-ftp-binary-file-name-regexp}: By default ange-ftp will | |
534 transfer files in ASCII mode. If a file being transferred matches the | |
535 value of this regexp then the FTP process will be toggled into BINARY | |
536 mode before the transfer and back to ASCII mode after the transfer. The | |
537 default is: | |
538 @example | |
539 (concat "\\.Z$\\|\\.lzh$\\|\\.arc$\\|\\.zip$\\|\\.zoo$\\|\\.tar$\\|" | |
540 "\\.dvi$\\|\\.ps$\\|\\.elc$\\|TAGS$\\|" | |
541 "\\.gif$\\|\\.EXE\\(;[0-9]+\\)?$") | |
542 @end example | |
543 @vindex ange-ftp-binary-file-name-regexp | |
544 | |
545 @code{ange-ftp-hash-mark-size}: Ange-ftp by default requests that the | |
546 FTP process sends hash marks (just @code{#} characters) during transfers | |
547 to keep track of how much data has been sent or received. This variable, | |
548 if non-@code{nil}, should be the number of kilobytes represented by the | |
549 FTP client's hash mark. The default value of 1 doesn't work for me --- I | |
550 use 2 instead. | |
551 @vindex ange-ftp-hash-mark-size | |
552 | |
553 @code{ange-ftp-process-verbose}: If this is @code{t} then ange-ftp will | |
554 be chatty about interaction with the FTP process. The default is @code{t}. | |
555 @vindex ange-ftp-process-verbose | |
556 | |
557 @code{ange-ftp-ftp-program-name}: This should be the name of the FTP | |
558 program to run on the local host. The default value of @code{"ftp"} | |
559 should be fine for most systems. | |
560 @vindex ange-ftp-ftp-program-name | |
561 | |
562 @code{ange-ftp-gateway-ftp-program-name}: Same as above, but this time | |
563 it's the name of the program to be used if a gateway is in use. The | |
564 default is again @code{"ftp"}, but some AT&T folks claim to use | |
565 something called @code{"pftp"} here. | |
566 @vindex ange-ftp-gateway-ftp-program-name | |
567 | |
568 @code{ange-ftp-make-backup-files}: A list of operating systems for which | |
569 ange-ftp will make Emacs backup files on the remote host. For example, | |
570 @code{'(unix)} makes sense, but @code{'(unix vms)} or @code{'(vms)} | |
571 would be silly, since VMS makes its own backups. The host type is | |
572 determined by the function @code{ange-ftp-host-type}. Possible host | |
573 types are: @code{dumb-unix}; @code{vos}; @code{vms}; @code{mts}; and | |
574 @code{unix}. The default of @code{nil} means make no backups on remote | |
575 hosts. | |
576 @vindex ange-ftp-make-backup-files | |
577 @cindex backup files | |
578 | |
579 @code{ange-ftp-path-format}: This variable dictates the the format of a | |
580 fully expanded remote pathname. This is a cons @code{(REGEXP . (HOST | |
581 USER PATH))}, where @code{REGEXP} is a regular expression matching the | |
582 full remote pathname, and @code{HOST}, @code{USER}, and @code{PATH} are | |
583 the numbers of parenthesised expressions in @code{REGEXP} for the components | |
584 (in that order). The syntax can be customised with this variable to a | |
585 certain extent, but there are limitations. The default is @* | |
586 @code{'("^/\\(\\([^@@/:]*\\)@@\\)?\\([^@@/:]*\\):\\(.*\\)" . (3 2 4))}. | |
587 @vindex ange-ftp-path-format | |
588 | |
589 @code{ange-ftp-multi-msgs}: A regular expression matching messages from | |
590 the ftp process that start a multiline reply. The default is @* | |
591 @code{"^220-\\|^230-\\|^226\\|^25.-\\|^221-\\|^200-\\|^530-\\|^4[25]1-"} | |
592 @vindex ange-ftp-multi-msgs | |
593 | |
594 @code{ange-ftp-good-msgs}: A regular expression matching messages from | |
595 the ftp process that indicate that the action that was initiated has | |
596 completed successfully. The default is | |
597 @code{"^220 \\|^230 \\|^226\\|^25. \\|^221 \\|^200 \\|^[Hh]ash mark"}. | |
598 @vindex ange-ftp-good-msgs | |
599 | |
600 @code{ange-ftp-skip-msgs}: A regular expression matching messages from | |
601 the ftp process that can be ignored. The default is | |
602 @example | |
603 (concat "^200 \\(PORT\\|Port\\) \\|^331 \\|^150 \\|^350 \\|^[0-9]+ bytes \\|" | |
604 "^Connected \\|^$\\|^Remote system\\|^Using\\|^ \\|Password:\\|" | |
605 "^local:\\|^Trying\\|^125 \\|^550-") | |
606 @end example | |
607 @noindent | |
608 but you might need to tweak it if ange-ftp is giving up when it | |
609 shouldn't. | |
610 @vindex ange-ftp-skip-msgs | |
611 | |
612 @code{ange-ftp-fatal-msgs}: A regular expression matching messages from | |
613 the FTP process that indicate something has gone drastically wrong | |
614 attempting the action that was initiated and that the FTP process should | |
615 (or already has) been killed. The default is | |
616 @example | |
617 (concat "^ftp: \\|^Not connected\\|^530 \\|^4[25]1 \\|rcmd: \\|" | |
618 "^No control connection\\|unknown host\\|^lost connection") | |
619 @end example | |
620 @vindex ange-ftp-fatal-msgs | |
621 | |
622 @code{ange-ftp-gateway-fatal-msgs}: Regular expression matching messages | |
623 from the rlogin / telnet process that indicates that logging in to the | |
624 gateway machine has gone wrong. The default is | |
625 @example | |
626 "No route to host\\|Connection closed\\|No such host\\|Login incorrect" | |
627 @end example | |
628 @vindex ange-ftp-gateway-fatal-msgs | |
629 | |
630 @code{ange-ftp-tmp-name-template}: This should be a directory and a | |
631 filename prefix indicating where ange-ftp should make temporary files. | |
632 The default of @code{"/tmp/ange-ftp"} should be fine for most systems. | |
633 @vindex ange-ftp-tmp-name-template | |
634 @cindex temporary files | |
635 | |
636 @code{ange-ftp-retry-time}: Number of seconds to wait before retrying if | |
637 a file or listing doesn't arrive. For slow connections, you might get a | |
638 ``listing unreadable'' error messages | |
639 @cindex listing unreadable error | |
640 or an empty buffer for a file that you know has something in it. The | |
641 solution is to increase the value of @code{ange-ftp-retry-time}. Its default | |
642 value is 5 which is plenty for reasonable connections. However, for | |
643 some transatlantic connections 20 might be a better value. | |
644 @vindex ange-ftp-retry-time | |
645 | |
646 @node Using ange-ftp, Getting help, Installing ange-ftp, Top | |
647 @comment node-name, next, previous, up | |
648 @chapter Using ange-ftp | |
649 | |
650 Once you have ange-ftp installed, you never need worry about using FTP | |
651 again. The interface is completely transparent, and you may now use | |
652 Emacs commands such as @kbd{C-x C-f} (@code{find-file}) | |
653 @pindex find-file | |
654 on @emph{any} | |
655 file that your local host (or, if you are using one) your gateway can | |
656 access. That file may be a regular file (for editing, viewing etc.), a | |
657 directory (for invoking Dired) or even a symbolic link | |
658 @cindex symbolic links | |
659 (pointing to a | |
660 directory or a regular file). All it takes is an extended filename | |
661 syntax. For example, if you give the filename | |
662 @example | |
663 /ange@@anorman:/tmp/notes | |
664 @end example | |
665 @noindent | |
666 to @code{find-file}, then ange-ftp will spawn an FTP process, connect to | |
667 the host @code{anorman} as user @code{ange}, get the file | |
668 @file{/tmp/notes} and pop up a buffer containing the contents of that | |
669 file as if it were on the local filesystem. If ange-ftp needed a | |
670 password to connect then it would prompt the user in the minibuffer. | |
671 From then on you can edit that file as if it were any other file: saving | |
672 is with @kbd{C-x C-s} as usual --- in fact, everything is as usual. | |
673 | |
674 Ange-ftp is also extremely useful for regular "file-transfer" FTP jobs. | |
675 Since Dired also works on remote directories when using ange-ftp, you | |
676 will be able to browse the filesystem on your favourite archive site | |
677 with consummate ease. | |
678 | |
679 @menu | |
680 * Remote filenames:: The ange-ftp extended filename syntax. | |
681 * Using Dired:: Browsing directories. | |
682 * Using a .netrc:: Preventing password pestering. | |
683 * Ange-ftp commands:: Interactive commands supplied by ange-ftp. | |
684 * DL support:: For hosts using descriptive directory listings. | |
685 * Non-Unix Hosts:: Some hosts have funny filenames. | |
686 * Completion:: On filenames and hostnames. | |
687 * Accessing the FTP process:: For when manual tinkering is needed. | |
688 @end menu | |
689 | |
690 @node Remote filenames, Using Dired, , Using ange-ftp | |
691 @comment node-name, next, previous, up | |
692 @section Remote filename syntax | |
693 | |
694 The general form of the extended filename syntax is | |
695 @example | |
696 /user@@host:path | |
697 @end example | |
698 @noindent | |
699 which refers to the file pointed to by @code{path} on machine | |
700 @code{host} when logging in as user @code{user}. When @code{path} is | |
701 supplied as a relative file-name (that is, without a leading @samp{/}) | |
702 it is relative to @code{user}'s home directory (although such relative | |
703 filenames are ultimately converted to absolute ange-ftp pathnames). You | |
704 may even refer to home directories | |
705 @cindex home directories of other users | |
706 @cindex other users' home directories | |
707 of users on remote Unix sites using the | |
708 standard tilde @samp{~} notation. | |
709 @code{host} needs to be | |
710 the fully qualified pathname if the local or gateway machine requires it | |
711 to be (however hostname completion is available if it is included in | |
712 your @file{.netrc} -- @xref{Using a .netrc}), or it may be an IP | |
713 @cindex IP numbers | |
714 @cindex numeric Internet addresses | |
715 number if your nameserver can't find the site. The @code{user@@} part | |
716 may be omitted, in which case the username is chosen on the basis of the | |
717 variable @code{ange-ftp-default-user} | |
718 @vindex ange-ftp-default-user | |
719 (@xref{Other options}) and your | |
720 @file{.netrc}. If a password is requested by the FTP process, ange-ftp | |
721 will either prompt you for it, or generate one on the basis of the | |
722 variables @code{ange-ftp-default-password}, | |
723 @vindex ange-ftp-default-password | |
724 and your @file{.netrc}. | |
725 | |
726 Thus the following are all valid ange-ftp filenames: | |
727 @example | |
728 /anonymous@@waldo.uranium.com:pub/games/wumpus | |
729 /root@@127.44.3.1:/etc/passwd | |
730 /jbrown@@freddie.ucla.edu:~mblack/ | |
731 /alpha.gnu.ai.mit.edu:ange-ftp/ange-ftp.tar.Z | |
732 @end example | |
733 | |
734 @node Using Dired, Using a .netrc, Remote filenames, Using ange-ftp | |
735 @comment node-name, next, previous, up | |
736 @section Using Dired | |
737 | |
738 This feature of ange-ftp is particularly useful when file-transfers, as | |
739 opposed to file-editing, are the order of the day. Simply run | |
740 @code{find-file} on a directory to | |
741 get a listing of the files in that directory. For example, you might | |
742 run @code{find-file} on | |
743 @example | |
744 /anonymous@@archive.site.com:pub | |
745 @end example | |
746 @noindent | |
747 to see what's in the @file{pub} directory of your favourite archive | |
748 @cindex archive sites | |
749 site. This brings up a Dired buffer of all the files in that directory. | |
750 The @kbd{f} command is useful for looking at @file{README} files --- if | |
751 you then decide to save it @kbd{C-x C-w} is useful. You can also use | |
752 this method to copy files, but the @kbd{c} command is easier. The | |
753 @kbd{f} command can also be used to descend the directory tree by | |
754 applying it to directories. | |
755 | |
756 You can also use Dired to refresh ange-ftp's internal cache. If you | |
757 (or anybody else) has changed a remote directory since you first accessed it | |
758 with ange-ftp, completion is not provided on any new files that ange-ftp | |
759 does not know about. If you have | |
760 (or create) a Dired buffer which contains the modified directory, | |
761 executing @code{revert-buffer} | |
762 @pindex revert-buffer | |
763 with a prefix argument (@kbd{C-u g} in the Dired buffer) | |
764 will force a refresh of both the the buffer @emph{and also ange-ftp's | |
765 internal cache}. If you find that filename completion isn't working on a | |
766 @cindex filename completion | |
767 file that you @emph{know} is there, this is how to fix the problem. | |
768 | |
769 The version of Dired supplied with Emacs version 18.58 (and earlier | |
770 versions) does not include a capability for multiple file transfers. The | |
771 @cindex multiple file transfers | |
772 @cindex wildcards | |
773 Tree Dired package (@xref{Obtaining source code}), however, is ideal | |
774 for this application. Tree Dired provides facilities for maintaining an | |
775 entire directory tree in a Dired buffer, for marking files which match a | |
776 certain regexp (or you can select files interactively) and then copying | |
777 all those files to your local host (or even a different remote host). | |
778 Another useful feature is Virtual Dired, which allows you to save Dired | |
779 @cindex virtual dired | |
780 buffers of remote hosts, allowing you to browse them at a later date | |
781 without actually needing to connect to the host. See the documentation | |
782 for Tree Dired for more details. | |
783 | |
784 Since ange-ftp is mostly transparent, modifying Dired or Tree Dired by | |
785 means of hooks or keybindings should still work. | |
786 | |
787 @node Using a .netrc, Ange-ftp commands, Using Dired, Using ange-ftp | |
788 @comment node-name, next, previous, up | |
789 @section Using a .netrc file | |
790 | |
791 Being prompted for passwords all the time can get rather annoying, but | |
792 there is a way to fix the problem --- a @file{.netrc} (but @xref{Other | |
793 options} and @code{ange-ftp-netrc-filename} | |
794 @vindex ange-ftp-netrc-filename | |
795 if you want another | |
796 filename) file in your home directory. Basically, this is a file (in the | |
797 format of Unix @code{netrc(5)}) which | |
798 contains the names of all the machines you regularly login to, as well | |
799 as the username and password you use for that machine. You can also | |
800 supply an account password, if required. | |
801 | |
802 Your @file{.netrc} file consists of lines of the form | |
803 @example | |
804 machine <machine-name> login <user-name> password <password> | |
805 @end example | |
806 @noindent | |
807 It doesn't all have to be on the one line, though: any @code{login} or | |
808 @code{password} commands in the file refer to the previous | |
809 @code{machine} command. You can also have @code{account | |
810 <account-passwd>} commands if you need special account passwords. | |
811 | |
812 For example, you might have the following line in your @file{.netrc}: | |
813 @example | |
814 machine Y.local.lan.edu login myname password secret | |
815 @end example | |
816 @noindent | |
817 Then if you run @code{find-file} on the file @file{/Y.local.lan.edu:somefile} | |
818 you will automatically be logged in as user @code{myname} with password | |
819 @code{secret}. You can still login under another name and password, if | |
820 you so desire: just include the @code{user@@} part of the filename. | |
821 | |
822 You may also include a default option, as follows: | |
823 @example | |
824 default login <user-name> password <password> | |
825 @end example | |
826 @noindent | |
827 which applies to any other machines not mentioned elsewhere in your | |
828 @file{.netrc}. A particularly useful application of this is with | |
829 anonymous logins: | |
830 @cindex anonymous FTP | |
831 @example | |
832 default login myname password myname@@myhost.edu | |
833 @end example | |
834 @noindent | |
835 so that accessing @file{/anyhost:anyfile} will automatically log you in | |
836 anonymously, provided the host is not mentioned in the @file{.netrc}. | |
837 Note also that if the value of @code{ange-ftp-default-user} is | |
838 @vindex ange-ftp-default-user | |
839 non-@code{nil}, its value will have precedence over the username | |
840 supplied in the default option of the @file{.netrc}. | |
841 | |
842 The @file{.netrc} file is also useful in another regard: machines | |
843 included in it are provided with hostname completion. That is, for any | |
844 @cindex hostname completion | |
845 machine in the @file{.netrc}, you need only type a slash and the first | |
846 few characters of its name and then press @key{TAB} to be logged in | |
847 automatically with a username and password from the @file{.netrc} file. | |
848 So it's a good idea to put hosts you use regularly in your @file{.netrc} | |
849 as well: | |
850 @example | |
851 machine archive.site.com login anonymous password myname@@X.local.lan.edu | |
852 @end example | |
853 | |
854 | |
855 @node Ange-ftp commands, DL support, Using a .netrc, Using ange-ftp | |
856 @comment node-name, next, previous, up | |
857 @section Ange-ftp commands | |
858 | |
859 Ange-ftp supplies a few interactive commands to make connecting with | |
860 hosts a little easier. | |
861 | |
862 @noindent | |
863 Command @code{ange-ftp-set-user}: Prompts for a hostname and a username. | |
864 Next time access to the host is attempted, ange-ftp will attempt to log | |
865 in again with the new username. | |
866 @pindex ange-ftp-set-user | |
867 | |
868 @noindent | |
869 Command @code{ange-ftp-set-passwd}: Prompts for a hostname, user and | |
870 password. Future logins to that host as that user will use the given | |
871 password. | |
872 @pindex ange-ftp-set-passwd | |
873 | |
874 @noindent | |
875 Command @code{ange-ftp-set-account}: Prompts for a hostname, user and | |
876 account. Future logins to that host as that user will use the given | |
877 account. | |
878 @pindex ange-ftp-set-account | |
879 | |
880 Note that the effects of the above three commands only last the duration | |
881 of the current Emacs session. To make their effects permanent, you may | |
882 include them as lisp code in your @file{.emacs}: | |
883 @example | |
884 (ange-ftp-set-user HOST USER) | |
885 (ange-ftp-set-password HOST USER PASSWORD) | |
886 (ange-ftp-set-account HOST USER ACCOUNT) | |
887 @end example | |
888 @noindent | |
889 This is an alternative to using a @file{.netrc}; @xref{Using a .netrc}. | |
890 | |
891 @noindent | |
892 Command @code{ange-ftp-kill-ftp-process}: kill the FTP process | |
893 associated with a given buffer's filename (by default the current | |
894 buffer). This is an easy way to achieve a resynch: any future accesses | |
895 to the remote host will cause the FTP process to be recreated. | |
896 @pindex ange-ftp-kill-ftp-process | |
897 | |
898 @node DL support, Non-Unix Hosts, Ange-ftp commands, Using ange-ftp | |
899 @comment node-name, next, previous, up | |
900 @section Descriptive directory listings | |
901 | |
902 Some hosts (such as @code{cs.uwp.edu}) now use descriptive directory | |
903 listings | |
904 @cindex descriptive directory listings | |
905 @cindex extended directory listings | |
906 (which in fact contain @emph{less} information than the | |
907 standard listing!) when issued the @code{ls} command, and ange-ftp has | |
908 been modified to cope with this. Ange-ftp can detect such listings, but | |
909 if you regularly use a remote host which uses this extended listing | |
910 format you should set the variable @code{ange-ftp-dl-dir-regexp} to a | |
911 @vindex ange-ftp-dl-dir-regexp | |
912 regular expression which matches directories using the extended listing | |
913 format. You shouldn't anchor the regexp with @samp{$} -- that way the | |
914 regexp will match subdirectories as well. Alternatively, you can use | |
915 the interactive command @code{ange-ftp-add-dl-dir} to temporarily add a | |
916 @pindex ange-ftp-add-dl-dir | |
917 remote directory for this Emacs session only. | |
918 | |
919 Tree Dired has been modified to work with such descriptive listings. | |
920 | |
921 @node Non-Unix Hosts, Completion, DL support, Using ange-ftp | |
922 @comment node-name, next, previous, up | |
923 @section Using ange-ftp with non-Unix hosts | |
924 | |
925 Ange-ftp also works with some non-Unix hosts, although not necessarily | |
926 with all the features available with Unix hosts. VMS, CMS, and MTS | |
927 systems will all now work with ange-ftp and Tree Dired (although | |
928 Classical Dired may well be broken on such systems.) Filename completion | |
929 also now works on these hosts. | |
930 | |
931 Ange-ftp should be able to automatically detect which type of host you | |
932 are using (VMS, CMS or MTS), but if it is unable to do so you can fix | |
933 the problem by setting the appropriate | |
934 @code{ange-ftp-TYPE-host-regexp} variable (where @code{TYPE} is one of | |
935 @samp{vms}, @samp{cms} or @samp{mts}) -- see below. If ange-ftp is unable | |
936 to automatically detect any VMS, CMS or MTS host, please report this as | |
937 a bug: @xref{Bugs}. | |
938 | |
939 In all cases the file-name conventions of the remote host are converted | |
940 to a UNIX-ish format, and this is the format you should use to find | |
941 files on such hosts. | |
942 | |
943 @menu | |
944 * VMS support:: Using ange-ftp with VMS systems | |
945 * CMS support:: Using ange-ftp with CMS systems | |
946 * MTS support:: Using ange-ftp with MTS systems | |
947 @end menu | |
948 | |
949 @node VMS support, CMS support, , Non-Unix Hosts | |
950 @comment node-name, next, previous, up | |
951 @subsection VMS support | |
952 @cindex VMS filenames | |
953 VMS filenames are of the form @code{FILE.TYPE;##}, where both | |
954 @code{FILE} and @code{TYPE} can be up to 39 characters long, and | |
955 @code{##} is an integer version number between 1 and 32,767. Valid | |
956 characters in filenames are @samp{A}-@samp{Z}, @samp{0}-@samp{9}, | |
957 @samp{_}, @samp{-} and @samp{$}, however @samp{$} cannot begin a | |
958 filename and @samp{-} cannot be used as the first or last character. | |
959 | |
960 Directories in VMS are converted to the standard UNIX @samp{/} notation. | |
961 For example, the VMS filename | |
962 @example | |
963 PUB$:[ANONYMOUS.SDSCPUB.NEXT]README.TXT;1 | |
964 @end example | |
965 would be entered as | |
966 @noindent | |
967 @example | |
968 /PUB$$:/ANONYMOUS/SDSCPUB/NEXT/README.TXT;1 | |
969 @end example | |
970 @noindent | |
971 (The double @samp{$} is required to prevent Emacs from attempting to | |
972 expand an environment variable.) Similarly, to anonymously FTP the file | |
973 @file{[.CSV.POLICY]RULES.MEM;1} from @code{ymir.claremont.edu} you would | |
974 type @kbd{C-x C-f | |
975 /anonymous@@ymir.claremont.edu:CSV/POLICY/RULES.MEM;1}. You can always | |
976 drop off the @samp{;##} part at the end of the filename to get the | |
977 latest version. | |
978 | |
979 Sandy Rutherford provides some tips for using VMS hosts: | |
980 @itemize @bullet | |
981 @item | |
982 Although VMS is not case sensitive, EMACS running under UNIX is. | |
983 Therefore, to access a VMS file, you must enter the filename with upper | |
984 case letters. | |
985 | |
986 @item | |
987 To access the latest version of file under VMS, you use the filename | |
988 without the @samp{;} and version number. You should always edit the | |
989 latest version of a file. If you want to edit an earlier version, copy | |
990 it to a new file first. This has nothing to do with ange-ftp, but is | |
991 simply good VMS operating practice. Therefore, to edit @file{FILE.TXT;3} | |
992 (say 3 is latest version), do @kbd{C-x C-f | |
993 /ymir.claremont.edu:FILE.TXT}. If you inadvertently do | |
994 @example | |
995 @kbd{C-x C-f /ymir.claremont.edu:FILE.TXT;3} | |
996 @end example | |
997 @noindent | |
998 you will find that VMS will not allow | |
999 you to save the file because it will refuse to overwrite | |
1000 @file{FILE.TXT;3}, but instead will want to create @file{FILE.TXT;4}, | |
1001 and attach the buffer to this file. To get out of this situation, | |
1002 @kbd{M-x write-file /ymir.claremont.edu:FILE.TXT} will attach the buffer | |
1003 to latest version of the file. For this reason, in Tree Dired @kbd{f} | |
1004 (@code{dired-find-file}), | |
1005 @pindex dired-find-file | |
1006 always loads the file sans version, whereas @kbd{v}, | |
1007 (@code{dired-view-file}), | |
1008 @pindex dired-view-file | |
1009 always loads the explicit version number. The | |
1010 reasoning being that it reasonable to view old versions of a file, but | |
1011 not to edit them. | |
1012 | |
1013 @item | |
1014 VMS filenames often contain @samp{$} characters: make sure you always | |
1015 quote these as @samp{$$} and watch out for the Emacs bug which fails to | |
1016 quote @samp{$}'s when defaults are presented in the minibuffer: see | |
1017 @xref{Bugs}. | |
1018 @end itemize | |
1019 | |
1020 Ange-ftp should automatically detect that you are using a VMS host. If | |
1021 it fails to do so (which should be reported as a bug) you can use the | |
1022 command @code{ange-ftp-add-vms-host} | |
1023 @pindex ange-ftp-add-vms-host | |
1024 to inform ange-ftp manually. For a more permanent effect, or | |
1025 if you use a VMS host regularly, it's a good idea to set | |
1026 @code{ange-ftp-vms-host-regexp} to a regular expression matching that | |
1027 @vindex ange-ftp-vms-host-regexp | |
1028 host's name. For instance, if use use @code{ymir.claremont.edu} a lot, | |
1029 place the following in your .emacs: | |
1030 @example | |
1031 (setq ange-ftp-vms-host-regexp "^ymir.claremont.edu$") | |
1032 @end example | |
1033 | |
1034 @node CMS support, MTS support, VMS support, Non-Unix Hosts | |
1035 @comment node-name, next, previous, up | |
1036 @subsection CMS support | |
1037 Ange-ftp has full support, including Tree Dired support, for hosts | |
1038 running CMS. | |
1039 | |
1040 @cindex CMS filenames | |
1041 CMS filenames are entered in a UNIX-y way. Minidisks are | |
1042 treated as UNIX directories; for example to access the file @file{READ.ME} in | |
1043 minidisk @file{*.311} on @file{cuvmb.cc.columbia.edu}, you would enter | |
1044 @example | |
1045 /anonymous@@cuvmb.cc.columbia.edu:/*.311/READ.ME | |
1046 @end example | |
1047 If @file{*.301} is the default minidisk for this account, you could access | |
1048 @file{FOO.BAR} on this minidisk as | |
1049 @example | |
1050 /anonymous@@cuvmb.cc.columbia.edu:FOO.BAR | |
1051 @end example | |
1052 CMS filenames are of the form @file{FILE.TYPE}, where both @file{FILE} | |
1053 and @file{TYPE} can be up to 8 characters. Again, beware that CMS | |
1054 filenames are always upper case, and hence must be entered as such. | |
1055 | |
1056 Sandy Rutherford provides some tips on using CMS hosts: | |
1057 @itemize @bullet | |
1058 @item | |
1059 CMS machines, with the exception of anonymous accounts, nearly always | |
1060 need an account password. To have ange-ftp send an account password, | |
1061 you can either include it in your @file{.netrc} (@xref{Using a .netrc}), or use | |
1062 @code{ange-ftp-set-account}. | |
1063 @pindex ange-ftp-set-account | |
1064 | |
1065 @item | |
1066 Ange-ftp cannot send ``write passwords'' for a minidisk. Hopefully, we | |
1067 can fix this. | |
1068 @end itemize | |
1069 | |
1070 Ange-ftp should automatically detect that you are using a CMS host. If | |
1071 it fails to do so (which should be reported as a bug) you can use the | |
1072 command @code{ange-ftp-add-cms-host} | |
1073 @pindex ange-ftp-add-cms-host | |
1074 to inform ange-ftp manually. For a more permanent effect, or | |
1075 if you use a CMS host regularly, it's a good idea to set | |
1076 @code{ange-ftp-cms-host-regexp} to a regular expression matching that | |
1077 @vindex ange-ftp-cms-host-regexp | |
1078 host's name. | |
1079 | |
1080 @node MTS support, , CMS support, Non-Unix Hosts | |
1081 @comment node-name, next, previous, up | |
1082 @subsection MTS support | |
1083 Ange-ftp has full support, including Tree Dired support, for hosts | |
1084 running the Michigan terminal system, and should be able to | |
1085 automatically recognise any MTS machine. | |
1086 | |
1087 @cindex MTS filenames | |
1088 MTS filenames are entered in a UNIX-y way. For example, if your account | |
1089 was @file{YYYY}, the file @file{FILE} in the account @file{XXXX:} on | |
1090 @file{mtsg.ubc.ca} would be entered as | |
1091 @example | |
1092 /YYYY@@mtsg.ubc.ca:/XXXX:/FILE | |
1093 @end example | |
1094 In other words, MTS accounts are treated as UNIX directories. Of course, | |
1095 to access a file in another account, you must have access permission for | |
1096 it. If @file{FILE} were in your own account, then you could enter it in a | |
1097 relative path fashion as | |
1098 @example | |
1099 /YYYY@@mtsg.ubc.ca:FILE | |
1100 @end example | |
1101 MTS filenames can be up to 12 characters. Like UNIX, the structure of the | |
1102 filename does not contain a type (i.e. it can have as many @samp{.}'s as you | |
1103 like.) MTS filenames are always in upper case, and hence be sure to enter | |
1104 them as such! MTS is not case sensitive, but an EMACS running under UNIX | |
1105 is. | |
1106 | |
1107 Ange-ftp should automatically detect that you are using an MTS host. If | |
1108 it fails to do so (which should be reported as a bug) you can use the | |
1109 command @code{ange-ftp-add-mts-host} | |
1110 @pindex ange-ftp-add-mts-host | |
1111 to inform ange-ftp manually. For a more permanent effect, or | |
1112 if you use an MTS host regularly, it's a good idea to set | |
1113 @code{ange-ftp-mts-host-regexp} to a regular expression matching that | |
1114 @vindex ange-ftp-mts-host-regexp | |
1115 host's name. | |
1116 | |
1117 @node Completion, Accessing the FTP process, Non-Unix Hosts, Using ange-ftp | |
1118 @comment node-name, next, previous, up | |
1119 @section File- and host-name completion | |
1120 | |
1121 Full filename completion is supported on all remote UNIX hosts and some | |
1122 non-Unix hosts. Hostnames also have completion if they are mentioned in | |
1123 the @file{.netrc} and no username is specified. However using the | |
1124 filename completion feature can be a bit of a two edged sword. | |
1125 | |
1126 To understand why, we need to discuss how ange-ftp works. Whenever | |
1127 ange-ftp is asked to find a remote file (or directory) an @code{ls} | |
1128 command is sent to the FTP process to list all the files in the | |
1129 directory. This list is maintained in an internal cache, to provide | |
1130 filename completion for later requests on that directory. Ange-ftp keeps | |
1131 this cache up-to-date by monitoring Emacs commands which affect files | |
1132 and directories, but if a process outside Emacs (such as another user) | |
1133 changes a directory (e.g. a new file is added) | |
1134 completion won't work on | |
1135 that file since ange-ftp doesn't know about it yet. The solution if to | |
1136 force ange-ftp to reread the directory and update it's cache, and the | |
1137 easiest way to do that is with Dired --- @xref{Using Dired} to see how. | |
1138 | |
1139 Another problem is that the @code{ls} command can take a long time, | |
1140 especially when dealing with distant hosts over slow links. So if you're | |
1141 after a file in the @file{pub/images} directory but nothing else, it's a | |
1142 better idea to type @kbd{pub/images/file @key{TAB}} than @kbd{pub/im @key{TAB}} | |
1143 which will force a read of the @file{pub} directory (since | |
1144 ange-ftp needs to know how to complete @code{im}). A little extra typing | |
1145 can often save a lot of waiting. Don't be afraid to use the @key{TAB} | |
1146 key once the directory is cached, though. | |
1147 | |
1148 @node Accessing the FTP process, , Completion, Using ange-ftp | |
1149 @comment node-name, next, previous, up | |
1150 @section Accessing the FTP process buffer | |
1151 | |
1152 The FTP process used to access the remote files is available for access | |
1153 if you wish. It will be in a buffer | |
1154 @cindex process buffers | |
1155 @cindex buffers | |
1156 called @samp{"*ftp @var{remote-file-name}*"}, | |
1157 i.e. if you found the file | |
1158 @example | |
1159 /anonymous@@archive.site.com:pub/README | |
1160 @end example | |
1161 @noindent | |
1162 there will be a buffer | |
1163 @example | |
1164 *ftp anonymous@@archive.site.com* | |
1165 @end example | |
1166 @noindent | |
1167 where all the transfers are taking place. You can have a look at the buffer | |
1168 using @kbd{C-x b} as usual, and even type in commands to the FTP process | |
1169 under an interface very much like @samp{shell-mode}. There are two | |
1170 instances when doing this can be very useful: one is accessing non-UNIX | |
1171 hosts, where Dired and filename completion may not work (if ange-ftp | |
1172 even works at all). The other is multiple (i.e. wildcard) file transfers | |
1173 @cindex multiple file transfers | |
1174 @cindex wildcards | |
1175 which the standard version of Dired does not handle (but Tree Dired | |
1176 @emph{does}, and is worth installing for this feature alone.) If you | |
1177 are going to use @code{mget} or @code{mput}, make sure you type | |
1178 @code{glob} first: ange-ftp turns globbing off by default. Don't be | |
1179 afraid of changing directories, either --- ange-ftp always uses absolute | |
1180 pathnames when communicating with the FTP process. | |
1181 | |
1182 You can kill the FTP process at any time simply by killing this buffer. | |
1183 @cindex FTP processes | |
1184 @cindex processes | |
1185 This won't cause ange-ftp any grief whatsoever --- if you later make | |
1186 another request to that host, ange-ftp will simply fire up another | |
1187 process and create a new buffer to hold it. | |
1188 | |
1189 @node Getting help, Bugs, Using ange-ftp, Top | |
1190 @comment node-name, next, previous, up | |
1191 @chapter Getting help | |
1192 | |
1193 Ange-ftp has its own mailing list modestly called ange-ftp-lovers where | |
1194 ange-ftp users discuss new features, problems, bug fixes etc. There is | |
1195 also another list called ange-ftp-lovers-announce which is reserved | |
1196 exclusively for the announcement of new versions. All | |
1197 users of ange-ftp are welcome to subscribe (see below) to either of | |
1198 these lists. New versions of ange-ftp are posted periodically to | |
1199 these lists. | |
1200 | |
1201 To [un]subscribe to ange-ftp-lovers or ange-ftp-lovers-announce, or to | |
1202 report mailer problems with the list, please mail one of the following | |
1203 addresses: | |
1204 @example | |
1205 ange-ftp-lovers-request@@anorman.hpl.hp.com | |
1206 ange-ftp-lovers-request%anorman.hpl.hp.com@@hplb.hpl.hp.com | |
1207 hplb.hpl.hp.com!anorman.hpl.hp.com!ange-ftp-lovers-request | |
1208 hplabs.hpl.hp.com!anorman.hpl.hp.com!ange-ftp-lovers-request | |
1209 @end example | |
1210 @noindent | |
1211 Please don't forget the @samp{-request} part, and please make it clear | |
1212 in the request which mailing list you wish to join. | |
1213 | |
1214 For mail to be posted directly to ange-ftp-lovers, send to one of the | |
1215 following addresses: | |
1216 @example | |
1217 ange-ftp-lovers@@anorman.hpl.hp.com | |
1218 ange-ftp-lovers%anorman.hpl.hp.com@@hplb.hpl.hp.com | |
1219 hplb.hpl.hp.com!anorman.hpl.hp.com!ange-ftp-lovers | |
1220 hplabs.hpl.hp.com!anorman.hpl.hp.com!ange-ftp-lovers | |
1221 @end example | |
1222 @noindent | |
1223 The ange-ftp-lovers mailing list is archived on | |
1224 @example | |
1225 ftp.reed.edu:pub/mailing-lists/ange-ftp/ | |
1226 @end example | |
1227 | |
1228 The newsgroup @code{gnu.emacs.help} also occasionally discusses ange-ftp. | |
1229 | |
1230 @node Bugs, Concept Index, Getting help, Top | |
1231 @comment node-name, next, previous, up | |
1232 @chapter Bugs and Wish List | |
1233 | |
1234 Here is a list of the known bugs in ange-ftp: | |
1235 | |
1236 @itemize @bullet | |
1237 @item | |
1238 Be warned that files created by using ange-ftp will take account of the | |
1239 umask | |
1240 @cindex umask | |
1241 of the ftp daemon process rather than the umask of the creating | |
1242 user. This is particulary important when logging in as the root user. | |
1243 The way that I tighten up the ftp daemon's umask under HP-UX is to make | |
1244 sure that the umask is changed to 027 before I spawn @file{/etc/inetd}. I | |
1245 suspect that there is something similar on other systems. | |
1246 | |
1247 @item | |
1248 Some combinations of FTP clients and servers break and get out of sync | |
1249 when asked to list a non-existent directory. Some of the | |
1250 @code{ai.mit.edu} machines cause this problem for some FTP clients. | |
1251 | |
1252 @item | |
1253 Ange-ftp does not check to make sure that when creating a new file, | |
1254 you provide a valid filename for the remote operating system. | |
1255 If you do not, then the remote FTP server will most likely | |
1256 translate your filename in some way. This may cause ange-ftp to | |
1257 get confused about what exactly is the name of the file. The | |
1258 most common causes of this are using lower case filenames on systems | |
1259 which support only upper case, and using filenames which are too | |
1260 long. | |
1261 | |
1262 @item | |
1263 Null (blank) passwords confuse both ange-ftp and some FTP daemons. | |
1264 | |
1265 @item | |
1266 ange-ftp likes to use pty's | |
1267 @cindex pty | |
1268 to talk to its FTP processes. If GNU Emacs | |
1269 creates a FTP process that only talks via pipes (for example, if | |
1270 @code{process-connection-type} is @code{nil}) | |
1271 @vindex process-connection-type | |
1272 then ange-ftp won't be getting the information it requires at the time that | |
1273 it wants it since pipes flush at different times to pty's. One | |
1274 disgusting way around this problem is to talk to the FTP process via | |
1275 rlogin which does the `right' things with pty's. | |
1276 | |
1277 @item | |
1278 You need to quote @samp{$} characters in filenames by using @samp{$$} | |
1279 instead. This isn't actually a bug, but rather an Emacs convention | |
1280 (which allows environment variables in filenames.) What @emph{is} an bug | |
1281 is that when filenames containing @samp{$}'s are inserted in the | |
1282 minibuffer as defaults, the @samp{$} is not converted into the @samp{$$} | |
1283 quoted form --- hopefully this will be fixed in version 19. It doesn't | |
1284 usually bother Unix users, but VMS filenames often contain @samp{$}. | |
1285 Incidentally, Sebastian Kremer's @code{gmhist} package | |
1286 @pindex gmhist | |
1287 (which comes with the Tree Dired distribution: @xref{Obtaining source code}) | |
1288 fixes this bug. | |
1289 | |
1290 @item | |
1291 @cindex symbolic links | |
1292 Some hosts (notably ULTRIX) | |
1293 @cindex ULTRIX | |
1294 mark symbolic links with a @samp{@@} character in an @code{ls -F} | |
1295 listing. The variable @code{dired-ls-F-marks-symlinks} | |
1296 @vindex dired-ls-F-marks-symlinks | |
1297 when set to @code{t} (the default) alerts Dired to this behaviour and | |
1298 everything is OK. Enabling this behaviour by default is not generally a | |
1299 problem on hosts which does @emph{not} mark symlinks in this way, but if | |
1300 you have @code{dired-ls-F-marks-symlinks} set to @code{t} while | |
1301 accessing a such a host, then Dired will think that a symbolic link whose name | |
1302 ends in @samp{@@} (a strange thing indeed!) is a regular file. The fix | |
1303 (other than setting @code{dired-ls-F-marks-symlinks to} @code{nil}, a bad idea | |
1304 if you regularly access hosts who mark symbolic links) is to remove | |
1305 @samp{F} from the @code{ls} listing switches (use @kbd{C-u s} in the | |
1306 Dired buffer.) | |
1307 | |
1308 Another problem with symbolic links arises with hosts who do not show | |
1309 the linked file with @samp{->} in the listing, meaning that Dired will | |
1310 not recognize the symlink. The solution here is to get a decent | |
1311 @code{ls} program on that machine. | |
1312 | |
1313 @item | |
1314 No classic dired support for non-UNIX systems. Tree dired was enough. | |
1315 | |
1316 @item | |
1317 If a directory listing is attempted for an empty directory on (at least some) | |
1318 VMS hosts, an ftp error is given. This is really an ftp bug, and I don't | |
1319 know how to get ange-ftp work to around it. | |
1320 | |
1321 @item | |
1322 Bombs on filenames that start with a space. Deals well with filenames | |
1323 containing spaces, but beware that the remote ftpd may not like them much. | |
1324 | |
1325 @item | |
1326 @cindex auto-saving | |
1327 Doesn't autosave. Maybe someone could implement auto-saving on the local | |
1328 host ... | |
1329 | |
1330 @item | |
1331 @cindex compressing files | |
1332 The code to do compression of files over ftp is not as careful as it | |
1333 should be. It deletes the old remote version of the file, before | |
1334 actually checking if the local to remote transfer of the compressed file | |
1335 succeeds. Of course to delete the original version of the file after | |
1336 transferring the compressed version back is also dangerous, because some | |
1337 OS's have severe restrictions on the length of filenames, and when the | |
1338 compressed version is copied back the @file{-Z} or @file{.Z} may be | |
1339 truncated. Then, ange-ftp would delete the only remaining version of the | |
1340 file. Maybe ange-ftp should make backups when it compresses files? | |
1341 | |
1342 @item | |
1343 @cindex copying | |
1344 Remote to remote copying of files on non-Unix machines can be risky. Depending | |
1345 on the variable @code{ange-ftp-binary-file-name-regexp}, ange-ftp will use binary | |
1346 mode for the copy. Between systems of different architecture, this still | |
1347 may not be enough to guarantee the integrity of binary files. Binary file | |
1348 transfers from VMS machines are particularly problematical. | |
1349 | |
1350 @item | |
1351 @cindex CMS minidisks | |
1352 Some CMS machines do not assign a default minidisk when you ftp them as | |
1353 anonymous. It is then necessary to guess a valid minidisk name, and | |
1354 @code{cd} to it. This is (understandably) beyond ange-ftp; however | |
1355 Sebastian Kremer says: | |
1356 @quotation | |
1357 It is beyond ange-ftp, but if the @code{init} ftp macro were supported, one | |
1358 could write the appropriate @code{cd} command into that. I used to do that | |
1359 on a CMS machine I had an account on because I never could remember | |
1360 the name of the minidisk. I think I even had to give an @code{account} | |
1361 command, too. Supporting @code{init} would be a very handy thing. | |
1362 | |
1363 Hmm, why start @code{ftp(1)} with the @code{-n} flag at all? | |
1364 @end quotation | |
1365 | |
1366 @item | |
1367 For CMS support, we send too many @code{cd}'s. Since @code{cd}'s are | |
1368 cheap, I haven't worried about this too much. Eventually, we should have | |
1369 some caching of the current minidisk. | |
1370 @end itemize | |
1371 | |
1372 If you find any bugs or problems with this package, @strong{please} | |
1373 e-mail the author. Ideas and constructive comments are especially | |
1374 welcome. So are any enhancements to ange-ftp, preferably debugged and | |
1375 documented. Also welcome are any typo fixes, corrections or additions to | |
1376 this manual. And just so you don't forget, here's Ange's address again: | |
1377 @example | |
1378 ange@@hplb.hpl.hp.com | |
1379 @end example | |
1380 @noindent | |
1381 Enjoy! | |
1382 | |
1383 @node Concept Index, Variable and command index, Bugs, Top | |
1384 @comment node-name, next, previous, up | |
1385 @unnumbered Concept Index | |
1386 | |
1387 @printindex cp | |
1388 | |
1389 @node Variable and command index, , Concept Index, Top | |
1390 @unnumbered Variable and command index | |
1391 | |
1392 @printindex vr | |
1393 | |
1394 @contents | |
1395 | |
1396 @bye | |
1397 |