Tk Library Source Code

View Ticket
Login
Ticket UUID: 476804
Title: geturl handlers in protocol packages
Type: RFE Version: None
Submitter: patthoyts Created on: 2001-10-31 16:13:24
Subsystem: ftp Assigned To: andreas_kupries
Priority: 3 Low Severity:
Status: Closed Last Modified: 2002-01-27 05:15:28
Resolution: Closed By: patthoyts
    Closed on: 2002-01-26 22:15:28
Description:
The uri module implements a general geturl method which
delegates to the scheme handler. Thus uri::geturl
file:// is handled by the uri packaage, uri::geturl
http:// is passed off to http::geturl.

We should implement a geturl procedure in the ftp
package and in any other package implementing such
internet protocols (gopher, news?)
User Comments: patthoyts added on 2002-01-27 05:15:28:
Logged In: YES 
user_id=202636

I'm going to commit this patch now. My only outstanding
concern is that I'm currently not using the ftp::ParseList
code. Really I should fix the split to cope with DOS/unix ls
results. I think this does the job though.

patthoyts added on 2002-01-12 06:16:02:
Logged In: YES 
user_id=202636

Re-opening because I failed to notice that this was closed
and I donT want to copy everything into a new bug report.

patthoyts added on 2002-01-12 04:47:36:

File Added - 15911: ftp_geturl.patch

Logged In: YES 
user_id=202636

Here is a patch that works for my win32 based ftp server.
I'm suspect it would be better to fix the ParseList proc
rather than avoid it but it's difficult to be sure of
parsing ls -l output from different platforms (I'm thinking
VMS could be _really_ different).

patthoyts added on 2002-01-11 16:22:57:
Logged In: YES 
user_id=202636

This doesn't work too well. I'll work on this a little and
generate a patch but 
  uri::geturl ftp://luser:lpasswd@ftpserver/file.txt
should use the user and password, hence:

    array set urlparts [uri::split $url]

    if {$urlparts(user) == {}} {
        set urlparts(user) anonymous 
    }
    if {$urlparts(pwd) == {}} {
      set urlparts(pwd) [email protected]
    }

    set fdc [ftp::Open $urlparts(host) \
        $urlparts(user) $urlparts(pwd)]

But more significantly the ftp::List processing fails
completely when I'm using a windows based ftp server and
also fails on the client side when I'm working within tkcon.

For tkcon the ftp::List command has been renamed so:

    # Fix for the tkcon List enhancements in ftp.tcl
    set List ::ftp::List_org
    if {[info command $List] == {}} {
        set List ::ftp::List 
    }

but I'm still working on the list processing. Maybe tonight
when I can play with Windows, Linux and OpenBSD servers.
We'll need to try this on a VMS server and any other
weirdies too I guess. (Are there still any VMS servers?)

andreas_kupries added on 2001-11-17 06:37:57:
Logged In: YES 
user_id=75003

Patch committed to head.

andreas_kupries added on 2001-11-17 06:36:14:

File Added - 13443: 476804.diff

Logged In: YES 
user_id=75003

Enclosed a patch implementing the FR for ftp urls.

andreas_kupries added on 2001-11-07 07:33:10:
Logged In: YES 
user_id=75003

I agree.

Attachments: