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

[REBOL] Re: read ftp:// error

From: sterling:rebol at: 31-May-2001 10:33

The real issue is of localization which is an issue all to itself and not particularly related to FTP. However, for the purposes of patching your FTP scheme and following the ideas already put forth in this thread, let me suggest the following change. As you have noticed, the problem is that REBOL is reading the directory before the download abd is having trouble parsing the directory information. It does this because it is trying to find out how large the file is before download so that it can download most efficiently... almost all FTP clients do this in order to display a progress bar. Anyhow, here's an added function to convert a month abbreviation to the REBOL readable version and a change to the first line of the add-date function in the FTP protocol. convert-month: func [month [string!] /local conv seek] [ conv: [ "Mai" ["May"] ] if seek: find conv month [return first first find seek block!] month ] add-date: func [] [ month: convert-month first pdate ; these lines reverse the month and day so we can make a date of it ... ... ... ] The conv block in convert-month can be extended to handle any number of languages simply by adding another string before the block containing the result version. For example, if May were also abbreviated as "Moi", and "Mal" in some other languages then conv would have a line like this: Mai "Moi" "Mal" ["May"] The function finds what you have, "Mai" or other abbreviation in the list. If it does find it, it then grabs the element in the first block. This way you can have as many mappings from other languages to the result as you want. If you do compile a list of abbreviations from elsewhere please post them as we might include this type of solution in the next versions. Needless to say, this blowout will be fixed one way or another. Sterling