r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Linux] group for linux REBOL users

Anton
31-Aug-2010
[3824]
Do you have a file FreeSans.ttf at that location?
Look for it with linux shell command:
	locate FreeSans.ttf
Oldes
31-Aug-2010
[3825]
I'm not using View for a very long time, but I guess you must first 
make the font object!
Graham
31-Aug-2010
[3826x2]
MaxV has released a Debian package ... http://synapse-ehr.com/forums/showthread.php?130-Ubuntu-Debian-package&p=764#post764
Anyone running Debian who can test it?
Andreas
31-Aug-2010
[3828]
Works fine.
Graham
31-Aug-2010
[3829]
And it is View ?
Andreas
31-Aug-2010
[3830]
Nope. Core 2.7.7.
caelum
31-Aug-2010
[3831]
I have been playing with this for hours and have not made any progress 
after reading everything I could find about ports and ftp. Why does 
the following script not work?

    ftp-port: open [
        scheme: 'ftp 
        host: "ftp.mysite.org" 
        port-id: 21 
        user: "[user-:-mysite-:-org]" 
        pass: "xxxxxxxxxx"
    ] 
    write ftp-port "Test File" 
    close ftp-port

It gives the following error.


** Script Error: write expected destination argument of type: file 
url object block
** Where: func [face value]
Graham
31-Aug-2010
[3832]
You haven't specified a file to write to
Oldes
31-Aug-2010
[3833x5]
you can try to use this: http://rebol.wik.is/Rebol3/Schemes/Ftp
Also as you can see, READ and WRITE does not support PORT! as an 
argument... at least not in R2
uh... sorry, now I see the link is for R3
Just dont' use the OPEN in the first line! And it will be working.
ftp-port: [scheme: 'ftp  host: "ftp.mysite.org"  user: "[user-:-mysite-:-org]" 
 pass: "xxxxxxxxxx"]
read ftp-port
caelum
31-Aug-2010
[3838]
Thanks Oldes, I'll give that a try.
Oldes
31-Aug-2010
[3839x3]
ftp-port: [scheme: 'ftp  host: "ftp.mysite.org"  user: "[user-:-mysite-:-org]" 
 pass: "xxxxxxxxxx" target: %test.txt]
write ftp-port "hello"
Maybe there is some better way.. I don't remember it as I'm not using 
such a script.
I guess you are not using clasic way because of the #"@" char in 
user name.
Graham
31-Aug-2010
[3842]
I think you just need to change the host to ftp.mysite.org/testfile 
and it should work
caelum
31-Aug-2010
[3843]
You are correct, I cannot use the classic way due to the #['-:-'].
Graham
31-Aug-2010
[3844]
but the way you have it above you haven't specificed a target file
caelum
31-Aug-2010
[3845]
Oh, you are right, no target file.
Graham
31-Aug-2010
[3846]
Script Error: write expected destination argument of type: file url 
object block
Oldes
31-Aug-2010
[3847]
Also note that you must use path if you don't want to write to root! 
Don't listen Graham, Host is just Host
Graham
31-Aug-2010
[3848]
the errors are meaningful!
caelum
31-Aug-2010
[3849]
Yep! One day I'll learn to read.
Graham
31-Aug-2010
[3850x8]
sorry ... you need a path element in your object
block ...
scheme host path port user and pass
port-id
You can tell I haven't done this for a long while either
maybe this will work??


write ftp://user%40mysite.org:[xxxx-:-ftp-:-mysite-:-org]/testfile.txt "hello"
ie. url-encode the username
actually this conversation should be in 'Core group
Oldes
31-Aug-2010
[3858]
Anyway... using block or url is same.. the connection is cached... 
right.
caelum
31-Aug-2010
[3859]
url-encode the username. I tried that, did not work.
Graham
31-Aug-2010
[3860]
ok ... need to use the block form then
caelum
31-Aug-2010
[3861]
So I need to add a path in the block statement?
Graham
31-Aug-2010
[3862]
yep
Oldes
31-Aug-2010
[3863x2]
You can see the caching when you do something like:
trace/net on

conn: [scheme: 'ftp  host: "ftp.mysite.org"  user: "[user-:-mysite-:-org]" 
 pass: "xxxxxxxxxx"]
loop 2 [probe read conn]
And last thing - you may need also passive: true in the conn block
caelum
31-Aug-2010
[3865]
Thanks for all the info, I'll try once more.
Graham
31-Aug-2010
[3866]
It's either path or target
caelum
1-Sep-2010
[3867]
Still no luck. I have looked at over 100+ google pages. Does anyone 
have a working example of a tcp connection using the non-standard 
method? So far I have not found one. Plenty of 'examples', but no 
actual working code. None of the 'examples' work for me. Everyone 
seems to be using the standard short method. Graham: Neither Path 
or Target worked. I checked the connection on my website and cpanel 
said I was logged in, so I have a connection, but I cannot get the 
correct syntax for 'write', so it goes back to the scheme host path 
port user pass path etc block. I'll buy someone a pint (I'm a Brit) 
or a cup of coffe for a working example of that code!
Graham
1-Sep-2010
[3868x2]
ok, you're on.
send the cofffee to me Wellington, NZ thanks
caelum
1-Sep-2010
[3870]
Well, two good friends of mine are moving to NZ at the end of the 
year. I'll ask them to deliver it or buy a fresh one for you when 
they arrive.
Maxim
1-Sep-2010
[3871x2]
remote-spec:  [scheme: 'ftp  host: "ftp.mysite.org"  user: "[user-:-mysite-:-org]" 
 pass: "xxxxxxxxxx"]
local-file: %text.txt

source-port: open/binary/direct/read local-file ; BINARY mode
print "Attempting FTP connection..."


target-port: open/binary/direct/new/write remote-spec ; BINARY mode

insert target-port copy source-port

attempt [close target-port]
attempt [close source-port]
oops pressed send too quickly... not sure I was done...
Graham
1-Sep-2010
[3873]
write [ scheme: 'ftp host: "ftp.compkarori.com" port-id: 21 target: 
%/htdocs/reb/test.txt user: "compka" pass: "*****" ] "hello"