Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: ftp bug

From: gscottjones:mchsi at: 4-Jun-2002 19:05

Hi, Romano, It is not often that I think I can help you, but I think I know what is going on. From: "Romano Paolo Tenca"
> I have a problem with a ftp read. > > 1) i did not chanage rebol code and it worked some time ago > 2) a window ftp program reads the same site correctly > > I think the problem is in the date format (year or time). Here it is raw
> read by Rebol ftp: > > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 14940 Dec 21 13:13 GNU.txt > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 27709 Nov 10 2001
> -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 1545 Nov 16 2001 gcmask.r > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 3194 Jan 10 13:19 getpath.r > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 18353 Dec 21 13:27 gpl.txt > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 1103 Jan 13 18:42 index.r > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 3773 Nov 13 2001 memusage.r > -rw-r--r-- 1 [otenc--tiscali--it] ftpuser 1199 Dec 22 01:15 refine.r >
I think the "problem" lies in the owner name and the way that REBOL parses the directory listing. With your sample listing, it appears that the owner name is [otenc--tiscali--it] and then the group name is "ftpuser". Currently, REBOL 2.5 and REBOL/View 1.2.1 set the parse rules as follows: ftp-dir: [ copy attr 10 attrs sp digits sp copy owner chars sp copy group chars sp copy size digits sp copy date [chars sp digits sp [digits some space | none]] copy time [[digits ":" digits sp] | none] file-rule ] where "copy owner chars sp" look for the definition of "chars" as: char: charset [#"a" - #"z" #"A" - #"Z" #"0" - #"9" "=+-_.:&$*',"] chars: [any char] Notice that there is no "@" symbol in the rule. A similar problem occurs with REBOL when using pop with an account name that includes an "@" symbol. The rule fails, and thereby throws off the parsing sequence where ultimately the date parsing fails. With my versions of REBOL, a little poking around gets to the definition block as follows (watch for line wrap):
>> probe pick pick get in system/schemes/ftp/handler 'parse-files 2 9
[#"a" - #"z" #"A" - #"Z" #"0" - #"9" "=+-_.:&$*',"] Assuming that you get this result, you can a simple fix in a newly started REBOL console session as follows:
>> probe append last pick pick get in system/schemes/ftp/handler
'parse-files 2 9 "@" =+-_.:&$*',@ == "=+-_.:&$*',@" With this added character in place, then retry your ftp query. I would try it myself, but I have no account using a similar "owner" name with an "@" symbol. Hope this helps. Please let me know either way. --Scott Jones