help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "save" to and "load" from file descriptor


From: Tom Holroyd (NIH/NIMH) [E]
Subject: Re: "save" to and "load" from file descriptor
Date: Sun, 10 Jun 2007 11:26:12 -0400
User-agent: Thunderbird 1.5.0.10 (X11/20070301)

You could try using the socket package from octave-forge. You can set up a 
regular socket, and then use the send and recv calls. They only work for byte 
strings at the moment, but you could serialize your cell array using the new 
xml code, or just sprintf.

Olaf Till wrote:
Hi,

I would like to send octave variables (I mean variables created with
"m-code", more exactly: a cell array) from one octave process to
another (on the same machine), using a pipe created with the
(interpreted) "pipe ()" command. The "save" and "load" commands seem
suitable for that, but need to be given a filename or "-" for stdout
or stdin. But I think it is no clean way, and may be unnecessarily
slow, to create a file or a named pipe for data exchange. Trying to
work with an unnamed pipe and "save ('-', ...)" and "load('-')", I had
no success trying "dup2 (pipe_in_descriptor, stdout)" on the sender
side and "dup2 (pipe_out_descriptor, stdin)" on the receiver side,
since the latter made octave abort ("stdin no tty"). Probably the
"save" and "load" functionality should be made available when file
descriptors are supplied instead of filenames, so that "save" and
"load" also work with pipes.

Can the code used by "save" and "load" be accessed from an oct-file,
supplying it with a file descriptor?

Olaf
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave


--
Tom Holroyd, Ph.D.
"The fundamentally misconceived nature versus nurture debate should be
abandoned: child development is inextricably both." -- Louann Brizendine


reply via email to

[Prev in Thread] Current Thread [Next in Thread]