stdin stdout?
[1/6] from: edoconnor:gma:il at: 24-Mar-2007 9:38
Forgive me if this is a foolish/n00b question, but can someone tell me
if REBOL is able to interface smoothly with standard input & output
(on *nix or solaris)? At work I have an enterprise app (on Solaris)
which I could potentially leverage REBOL if access to these standard
interfaces are available.
And, if not available today, is it planned for REBOL 3.0?
Thanks.
[2/6] from: gregg::pointillistic::com at: 24-Mar-2007 8:50
Hi Ed,
EOC> ...can someone tell me
EOC> if REBOL is able to interface smoothly with standard input & output
EOC> (on *nix or solaris)?
This is a simple echo process:
while [data: input] [print data]
Under Windows, command integration isn't as nice, but that should work
under *nix I believe. I think stderr is not doable though. At least
system/ports doesn't list it here.
INPUT is a mezzanine, so you can see that it just does this:
pick system/ports/input 1
The output port works similarly:
insert system/ports/output "test^/"
-- Gregg
[3/6] from: Tom:Conlin:gmai:l at: 24-Mar-2007 11:00
Ed O'Connor wrote:
> Forgive me if this is a foolish/n00b question, but can someone tell me
> if REBOL is able to interface smoothly with standard input & output
<<quoted lines omitted: 3>>
> And, if not available today, is it planned for REBOL 3.0?
> Thanks.
I sometimes want read/write from/to files/stdio on (Solaris) Unix
command lines in the same script
so I'll have blocks like this ... (really old code)
...
either none? system/script/args
[ set-modes system/ports/input [lines: false binary: false]
if error? err: try[buffer: copy system/ports/input ][
print ["ERROR " err halt]
]
][ ;;; relative or absolute path
file: either equal? (pick system/script/args 1) #"/"
[system/script/args]
[rejoin [system/options/path trim system/script/args]]
if error? err: try[buffer: read to-file file][
print ["ERROR " err halt]
]
]
block: parse/all buffer [...
[4/6] from: edoconnor:g:mail at: 24-Mar-2007 14:42
Thanks Gregg, thanks Tom.
I'll give it a whirl and see if I can make this happen. I'd much
rather use REBOL than write shell scripts.
Ed
On 3/24/07, Tom <Tom.Conlin-gmail.com> wrote:
[5/6] from: tim-johnsons:web at: 24-Mar-2007 11:36
On Saturday 24 March 2007 14:50, Gregg Irwin wrote:
> Under Windows, command integration isn't as nice, but that should work
> under *nix I believe. I think stderr is not doable though. At least
> system/ports doesn't list it here.
we've discussed this omission in the past. For my purposes, not having
a port to stderr is an inconvenience. I hope it is included in 3.0.
MTCW
tim
--
Tim Johnson <tim-johnsons-web.com>
Palmer, Alaska, USA
[6/6] from: compkarori::gmail::com at: 25-Mar-2007 7:27
Ed
See http://www.rebol.net/cgi-bin/upnews.r?view=0012
On 3/25/07, Ed O'Connor <edoconnor-gmail.com> wrote:
> Forgive me if this is a foolish/n00b question, but can someone tell me
> if REBOL is able to interface smoothly with standard input & output
> (on *nix or solaris)? At work I have an enterprise app (on Solaris)
> which I could potentially leverage REBOL if access to these standard
> interfaces are available.
>
> And, if not available today, is it planned for REBOL 3.0?
--
Graham Chiu
http://www.synapsedirect.com
Synapse-EMR - innovative electronic medical records system
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted