Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!ucbvax!hplabs!otter!hplb!anorman!ange From: ange@hplb.hpl.hp.com (Andy Norman) Newsgroups: comp.emacs Subject: Re: ange-ftp: ftp support for GNU Emacs Summary: ange-ftp.el patch #1 Message-ID: Date: 12 Feb 90 15:07:47 GMT References: <15020003@hpfijbm.HP.COM> Sender: news@hplb.hpl.hp.com Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 131 In-reply-to: mikec@hilbert.praxis.co.uk's message of 9 Feb 90 15:47:28 GMT >>>>> On 9 Feb 90 15:47:28 GMT, mikec@hilbert.praxis.co.uk (Michael Chace) said: mike> Just one slight problem with the package if you develop S/W on Un*x and mike> VMS. EXOS FTP servers don't support ls -l commands. I'm working on this. Don't waste time working on it. Just e-mail me directly. mike> Perhaps someone has solved this problem already so that the FTP dir mike> command is used instead. Below, I include a patch for the posted version of ange-ftp.el that may well solve your problem. The patch augments ange-ftp.el with the following features: * Optionally limit directory listings to use the 'dir' command. See the variable 'ange-ftp-brain-dead-ls-command' for more info. * Optionally use a specified user-name when not explicly given in the pathname. Previously the user's login name was used. See the variable 'ange-ftp-default-user' for more info. * Optionally generate a suitable password when logging in as user 'anonymous'. Previously the password had to be specified manually. See the variable 'ange-ftp-generate-anonymous-password' for more info. mike> Pity, since for talking to Un*x machines, I think the package is very good. Many thanks. The package was developed primarily for talking to Un*x machines, but a subset of the package *may* work with VMS. Hope this helps... if not then please e-mail me and I'll try to help out... -- ange -- #---------------------------------- cut here ---------------------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by Andy Norman on Mon Feb 12 10:00:35 1990 # # This archive contains: # ange-ftp.el-patch1 # # Error checking via wc(1) will be performed. LANG=""; export LANG PATH=/bin:/usr/bin:$PATH; export PATH echo x - ange-ftp.el-patch1 cat >ange-ftp.el-patch1 <<'@EOF' 5c5 < ; RCS: $Header: ange-ftp.el,v 2.11 90/01/31 11:42:09 ange Exp $ --- > ; RCS: $Header: ange-ftp.el,v 2.13 90/02/08 13:40:57 ange Exp $ 9c9 < ; Modified: Wed Jan 31 11:41:31 1990 (Ange) ange@anorman --- > ; Modified: Thu Feb 8 13:40:04 1990 (Ange) ange@anorman 63c63 < "^220 \\|^230 \\|^226 \\|^251 \\|^221 \\|^200 NOOP \\|^200 DELE " --- > "^220 \\|^230 \\|^226 \\|^251 \\|^221 \\|^200 NOOP \\|^200 DELE \\|^200 CWD " 102a103,105 > (defvar ange-ftp-default-user nil > "*User name to use when none is specied in a pathname. > If nil, then the name under which the user is logged in is used.") 103a107,112 > (defvar ange-ftp-generate-anonymous-password nil > "*Use a password of user@host when logging in as the anonymous user.") > > (defvar ange-ftp-brain-dead-ls-command nil > "*This ftp doesn't allow ls or dir commands to take options.") > 178a188,190 > (and ange-ftp-generate-anonymous-password > (string-equal user "anonymous") > (concat (user-login-name) "@" (system-name))) 365c377 < (user-login-name) --- > (or ange-ftp-default-user (user-login-name)) 471a484,490 > (defun ange-ftp-cd (dir) > "Change remote directory to the directory given. Return success." > (let ((host (ange-ftp-get-path-host dir)) > (user (ange-ftp-get-path-user dir)) > (path (ange-ftp-get-path-path dir))) > (ange-ftp-send-cmd host user (concat "cd " path)))) > 482,490c501,510 < (temp (make-temp-name ange-ftp-tmp-name-template))) < (if ange-ftp-ls-follow-symbolic-links < (if (> (length lsargs) 0) < (setq lsargs (concat lsargs "L")) < (setq lsargs "-L"))) < (if (ange-ftp-send-cmd host user (format "ls \"%s %s\" %s" < lsargs < path < temp)) --- > (temp (make-temp-name ange-ftp-tmp-name-template)) > lscmd) > (if ange-ftp-brain-dead-ls-command > (setq lscmd (concat "dir " path " " temp)) > (if ange-ftp-ls-follow-symbolic-links > (if (> (length lsargs) 0) > (setq lsargs (concat lsargs "L")) > (setq lsargs "-L"))) > (setq lscmd (format "ls \"%s %s\" %s" lsargs path temp))) > (if (ange-ftp-send-cmd host user lscmd) 522c542,544 < (string-match "^d" (ange-ftp-ls file "-dl")))))) --- > (if ange-ftp-brain-dead-ls-command > (ange-ftp-cd file) > (string-match "^d" (ange-ftp-ls file "-dl"))))))) @EOF set `wc -lwc