Streams
 

The streams commands allow you to get and receive data from the DMNSion system.

 

Create stream

Syntax: stream.create "msg id"(LF)

Creates a temporary stream.

Results:

  • OK "msg id" "stream id"(LF)
    Returns the stream identifier. The stream is write only.
  • FAIL "msg id"(LF)
    Unable to create a stream.

 

Close stream

Syntax: stream.close "msg id" "stream id"(LF)

Closes a stream.

Results:

  • OK "msg id"(LF)
    Stream was closed. If the stream was a temporary stream, all the data is deleted.
  • FAIL "msg id"(LF)
    Unable to close the stream.

 

Get length

Syntax: stream.length "msg id" "stream id"(LF)

Returns the number of bytes in the stream.

Results:

  • OK "msg id" length(LF)
    The legth or zero if the file is empty or non existent.

 

Read

Syntax: stream.read "msg id" "stream id" count(LF)

Reads the number of bytes given in the count.

Results:

  • OK "msg id" "base64 encoded string"(LF)
    The bytes are returned encoded in base 64. Note that the return may be less than what was asked for if the number of bytes left in the stream is less than that requested
  • FAIL "msg id"(LF)
    Unable to read any bytes .

 

Write

Syntax: stream.write "msg id" "stream id" "base64 encoded string"(LF)

Writes the decoded bytes to the stream.

Results:

  • OK "msg id"(LF)
    Write was successful.
  • FAIL "msg id"(LF)
    Unable to write the bytes.

 

Close

Syntax: stream.close "msg id" "stream id"(LF)

Closes a stream.

Results:

  • OK "msg id"(LF)
    The stream has been closed.
  • FAIL "msg id"(LF)
    Unable to close the stream.

 

Next: Notifications