DeviceStreams

DeviceStreams[device]

gives a list of all open streams associated with a device.

DeviceStreams[device,patt]

gives a list of streams whose names match the string pattern patt.

DeviceStreams[device,{patt1,patt2,}]

gives a list of streams whose names match any of the patti.

Details

  • A device can be specified either by a DeviceObject or by a string representing a device class.
  • Streams are automatically opened when a device is opened and are closed when it is closed.
  • DeviceStreams can return InputStream or OutputStream objects.

Examples

open allclose all

Basic Examples  (2)

Open a demo device and list its open streams:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Look up streams by pattern:

In[3]:=
Click for copyable input
Out[3]=

Look up streams by a list of patterns:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input

Read a list of bytes from an input stream associated with a device:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Close the device:

In[4]:=
Click for copyable input

Properties & Relations  (1)

See Also

DeviceOpen  DeviceClose  DeviceRead  DeviceWrite  DeviceReadBuffer  DeviceWriteBuffer  DeviceExecuteAsynchronous  Streams

Tutorials

Introduced in 2014
(10.0)