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

[REBOL] Re: Rebol, FTP and quotas

From: henrik:webz:dk at: 10-Mar-2002 2:01

09-03-2002 22:16:35, Nenad Rakocevic <[dockimbel--free--fr]> wrote:
>Hi, > >As far as i understand, this kind of errors occurs because the FTP handler doesn't recognize the response code sent by >the server.
OK
>Try this patch before starting your ftp session : > >>> system/schemes/ftp/handler/rmfile-check/2: ["250" "226"] >>> append system/schemes/ftp/handler/read-check/2 "200" >When you encounter such error, you should turn trace/net on and if possible, send the log to the ml. > >HTH, > >-DocKimbel. >
ok, thanks, I tried it and this is the result from a fresh new rebol session (usernames, passwords and urls removed):
>> system/schemes/ftp/handler/rmfile-check/2: ["250" "226"]
== [ ["DELE" port/locals/file] ["250" "226"] ]
>> append system/schemes/ftp/handler/read-check/2 "200"
== ["150" "125" "200"]
>> trace/net on >> ftp-dir: ftp://<user>:<pass>@<url>/path/
== ftp://<user>:<pass>@<url>/path/ Now I tried reading the directory which was empty:
>> print read ftp-dir
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<path>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ ["LIST"] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: [ "PASV" "227"] ** User Error: Server error: tcp 200 PORT command successful. ** Near: print read ftp-dir Same as before. Then I put a file there manually with an FTP-program:
>> print read ftp-dir
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ ["LIST"] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." file.txt Which seemed to work just fine Then I tried to read the contents of the file:
>> print read join ftp-dir ["file.txt"]
URL Parse: <user> <pass> <url> none path/ none Net-log: ["Opening" "tcp" "for" "FTP"] Net-log: [ none ["220" "230"]] Net-log: {220 ProFTPD 1.2.1 Server (<server>)} Net-log: [ ["USER" port/user] "331"] Net-log: "331 Password required for <user>." Net-log: [ ["PASS" port/pass] "230"] Net-log: "230 Welcome to <server>" Net-log: [ "SYST" "*"] Net-log: "215 UNIX Type: L8" Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["CWD" either empty? port/path ["./"] [join "./" port/path]] "250"] Net-log: "250 CWD command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for file list.} Net-log: [ none "226"] Net-log: "226-Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] ** User Error: Server error: tcp 226 Quotas on: using 0.00 of 10.00 MegaBytes ** Near: print read join ftp-dir ["file.txt"] Again same error as before. Just to make sure:
>> print join ftp-dir ["file.txt"]
ftp://<user>:<pass>@<url>/path/file.txt The syntax for the URL is correct.
>> system/version
== 1.2.1.3.1 and it's Rebol/View I'm running. Regards, Henrik Mikael Kristensen