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

World: r3wp

[Linux] group for linux REBOL users

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
[3873x4]
write [ scheme: 'ftp host: "ftp.compkarori.com" port-id: 21 target: 
%/htdocs/reb/test.txt user: "compka" pass: "*****" ] "hello"
works for me
it's the same as the normal one liner syntax
Moccachino will do fine
Maxim
1-Sep-2010
[3877]
my snippet is from a client app of mine and definitively works for 
me
Graham
1-Sep-2010
[3878]
Hold the marsmellow
Maxim
1-Sep-2010
[3879x2]
hehe
my example allows you to insert just a few bytes at a time and update 
a progress bar, if you replace the 'INSERT line by a loop which only 
copies 2000 bytes at a time until the copy returns none
Graham
1-Sep-2010
[3881x2]
My example just does what you asked for :)
Of course you could use my ftp protocol for Rebol3 if you're brave
caelum
1-Sep-2010
[3883]
I'm not that brave.
Maxim
1-Sep-2010
[3884]
ex:

while [buffer: copy/part source-port 2000][
	insert target-port buffer
	prin ">"
]
Graham
1-Sep-2010
[3885x2]
You have to be brave if you're a soldier in the rebolution!
If you live in the Midlands .. you can visit Sunanda :)
caelum
1-Sep-2010
[3887x2]
I'm a Brit living in WA state USA. My sister lives in the midlands. 
I'll visit Sunanda next time I visit the UK.
Looks like I owe two coffees. Give me a delivery address(es) and 
I'll oblige. Graham, you will havo to wait until December/January, 
but that's a Moccachino on its way.
Graham
1-Sep-2010
[3889x2]
hehe
At home we just use those single use Gregg's powdered Mocas that 
you pour into a cup and tip hot water into ... :)
caelum
1-Sep-2010
[3891]
Wow, I'm 80 miles outside Seattle and if any Seattlite heard you 
say that they would shriek!
Graham
1-Sep-2010
[3892]
BTW, we have the "Rebol School" group ... where we *encourage* questions
caelum
1-Sep-2010
[3893]
Always good to encourage questions. Thanks for the code, much appreciated. 
It will take me past this impasse I was in. Thinking about it, I 
must be brave because I want to replace all the PHP code I have written 
for my customers over the last seven years with Rebol code. If that 
is not brave, I don't know what is.
Graham
1-Sep-2010
[3894]
sensible ?