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

[REBOL] Re: transferring files

From: ingo:2b1 at: 7-May-2002 11:50

Hi Graham, Graham Chiu wrote:
> What do ppl use to transfer files across a network?
Here're two minimalistic scripts I once used ----- sending ------ #!/bin/r REBOL [] print ">>> File Send Utility >>>^/" fn: ask "Filename: " if #"%" = first fn [ remove/part fn 1 ] fn: to-file fn sv: ask "Server : " data: read/binary fn p: open/binary join tcp:// [sv ":" 4321] insert p data ----- end sending ------ ----- recieving ------ REBOL [] print "<<< File Recieve Utility <<<" fn: ask "Filename: " if #"%" = first fn [ remove/part fn 1 ] fn: to-file fn sp: open/binary tcp://:4321 wait sp cp: first sp while [data: copy cp] [ write/append/binary fn data ] ----- end recieving ------ I turned 'em into a single script that may act as sender or reciever, depending on how you call it, too. If anyone is interested, I'll send it along ... Kind regards, Ingo