WriteString

WriteString["file","string"]

writes "string" to a file.

WriteString[channel,"string"]

writes "string" to a stream or process.

WriteString[channel,expr1,expr2,]

converts the expri to strings, and then writes them in sequence to the specified output channel.

Details

Examples

open allclose all

Basic Examples  (2)

Write a string to a temporary file:

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

Print the file:

In[3]:=
Click for copyable input

Delete the temporary file:

In[4]:=
Click for copyable input

Open a stream:

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

Write to the stream:

In[2]:=
Click for copyable input

Close the stream:

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

Print the file:

In[4]:=
Click for copyable input

Scope  (1)

Properties & Relations  (1)

See Also

ReadString  WriteLine  Write  ExportString  BinaryWrite  DeviceRead  ProcessObject  OutputStream  LinkWrite  TextString

Tutorials

Introduced in 1988
(1.0)
| Updated in 2003
(5.0)