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

[REBOL] Re: read ftp:// error

From: gjones05:mail:orion at: 30-May-2001 9:57

From: "Thorsten Moeller"
> Hi Scott, > > thanks for your offer. HP`s moth abbreviations wouldn't be the
problem, but
> the server is just internal and running our ERP-System. So, it is not > possible to give you even a secure access to it for demonstration. > > Perhaps you can give me some instructions what to do, or what you have
> mind, so i can put it together. > Any results can be emailed off-list. > > Think about it !?
Yeah, best not to tinker too much with the multi-million dollar/franc/pound/mark/xxxx ERP system! :-) This is my generic approach to hacking a scheme: First, here is how to get your very own copy of the FTP scheme with which to play. To get a separate copy of the FTP scheme, type the following (changing the path to an appropriate one): echo %/path/to/my/ftp-hack.r probe system/schemes/ftp echo none Then, edit the file to remove the chevrons (">>") at the beginning and end. Add "FTP:" as the very first line of the code so that it starts off like: FTP: make object! [ scheme: 'FTP host: none port-id: 21 user: none ... Save this file. This is your working copy of the to-be hacked FTP scheme. After hacking, save the file, then with a fresh REBOL session, type: do %/path/to/my/ftp-hack.r which loads up the hacked ftp scheme. Then see the effects. Without change, the routine should fail in the same way. The first thing I would probably do at this point is verify where the error is occurring. (I still don't see how a simple FTP read gets to this code.) Search the FTP scheme for the word "to-date". There is only one occurence and is inside the parse-files function's subfunction add-date. You will notice a lot of action with a series 'pdate. I would add some print request to figure out both the structure of pdate and the values. For example: ... add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] loop length? loc: pdate [insert loc "/" loc: skip loc 2] system/words/remove pdate ;added commands on the left for easy spotting foreach pdate-part pdate [print pdate-part] if (now + 1) < loc: to-date rejoin pdate [loc/year: loc/year - 1] system/words/append info-block loc ] ... This example would accomplish two things: first find out about the pdate series and to verify the potential point of failure in that this foreach loop should execute shortly before failure. If this is the point of failure and if pdate is indeed showing the German(?) abbreviations for the months, then I would write a work-around to-date function that is local to this scheme, only. Of course, this exercise could lead in a number of directions, so there is no way to anticipate the directions. If you would like to share your results on or off list, that is fine with me. At some point if you/we get a work-around, we out to "publish" the result to the list so that the next poor soul will have an easier time. What do you think? --Scott Jones