On Thu, Aug 19, 1999 at 09:57:20AM -0400, Pete Toscano wrote:
> hello,
>
> fairlight's talking about urlview reminded me of a mod i made to
> url_handler.sh
> in order to get it to play nicely with ncftp. it seems that, since i have
> ncftp on my machine, url_view prefers to use (and i do too for that matter)
> ncftp. well -- at least with the version of ncftp i have (3.0beta18 from
> redhat 6.0 and 3.0beta19 from the redhat contrib archive) -- ncftp doesn't
> handle gets with urls (ex. ftp.site.org:/pub/wherever/whatever.tgz), it just
> suggests that you use ncftpget. because of this, i beat on url_handler.sh a
> little bit and the attached patch is what fell out. this is a very simple
> patch, but it seems to work for me whenever i use urlview to handle ftp urls.
> all it does is look for a trailing '/' in the url and if there is one, it'll
> fire up ncftp with the url, otherwise, it'll fire up ncftp get with the
> url. i'm sure it's not handling all possible cases, but, like i said, it
> works for me and i find it useful; i hope others will too.
>
> pete
The problem with this fix is that not all URL's that you expect to
have a trailing / may actually have one.
I wrote a small modification to urlview that prints out a message about
this before the menu. You can then edit the URL after selecting it
to add the / id required. My url_handler.sh does much the same as Pete's
except actually checking for ncftp. It amy handle some other things
however. Take a look at:-
http://lacebark.ntu.edu.au/mutt.html
for my solution. Perhaps we need to merge together the various suggestions
and have a better version of url_handler for the mutt-1.0 distribution.
Cheers, Brian.
> --
> Pete Toscano h:[EMAIL PROTECTED] w:[EMAIL PROTECTED]
> GPG fingerprint: AE5C 18E4 D069 76D3 9B9C D226 D86A 522F 446C 767A
> --- url_handler.sh.orig Thu Aug 19 09:42:25 1999
> +++ url_handler.sh Thu Aug 19 09:39:44 1999
> @@ -14,10 +14,19 @@
> case $method in
> ftp)
> target=`echo $url | sed 's;^.*://\([^/]*\)/*\(.*\);\1:/\2;'`
> - if [ -x /usr/bin/ncftp ]; then
> - ncftp $target
> + ending=`echo $url | sed 's;^.*\(.\)$;\1;'`
> + if [ $ending = '/' ]; then
> + if [ -x /usr/bin/ncftp ]; then
> + ncftp $url
> + else
> + ftp $target
> + fi
> else
> - ftp $target
> + if [ -x /usr/bin/ncftpget ]; then
> + ncftpget $url
> + else
> + ftp $target
> + fi
> fi
> ;;
>
--
Associate Professor Brian Salter-Duke (Brian Duke)
Chemistry, Faculty of Science, IT and Education, Northern Territory University,
Darwin, NT 0909, Australia. Phone 08-89466702. Fax 08-89466847
[EMAIL PROTECTED] http://www.smps.ntu.edu.au/school/compchem.html