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

-- 
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
        ;;
 

PGP signature

Reply via email to