[REBOL] Re: FTP access via a port spec
From: laurent::giroud::libertysurf::fr at: 4-Oct-2002 1:45
> The documentation (same url above) also states that things may be done such as
> this :
>>> ftp-port: open [
> scheme: 'ftp
> host: "ftp.site.com"
> user: "Username" ; and yes I set those right ;)
> pass: "Password"
> ]
> But says absolutely nothing about how to specify the file to manipulate.
> Trying to read from such port results in an error :
>>> read ftp-port
> ** Script Error: read expected source argument of type: file url object block
> ** Where: halt-view
> ** Near: read ftp-port
Well it looks like I am going to answer to myself :)
After writing this mail I suddenly remembered that one should not use 'read or
'write on ports but 'copy, 'pick or 'append instead.
So I tried this :
>> copy ftp-port
== [%cgi-bin/ %index.html %index.php %index.php3 %moncompteur.txt]
Which worked fine.
Doing the same thing by adding a "target: %index.html" in the port spec
definition allowed me to access any of the files individually : great !
I can now download and upload to the ftp server at will, but another question
comes to mind now : how does one rename/delete files or directories using a port
spec ? Is it even possible ?
And if it's not, is there another way to do it via ftp when the username
contains characters which are illegal in a Rebol URL ("@" for example) ?
Thanks,
Laurent