Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Input and Output / File Output  /
WriteString

  • WriteString[ channel , , , ... ] converts the to strings, and then writes them in sequence to the specified output channel.
  • WriteString uses the OutputForm of the .
  • WriteString allows you to create files which are effectively just streams of bytes.
  • WriteString does not put a newline at the end of the output it generates.
  • See notes for Write.
  • See the Mathematica book: Section 2.11.3.
  • Related package: Utilities`BinaryFiles`.

    Further Examples

    This opens a stream to a file tempw.

    In[1]:=

    Out[1]=

    This writes two strings to the stream.

    In[2]:=

    This writes another string to the stream.

    In[3]:=

    This closes the stream.

    In[4]:=

    Out[4]=

    Here are the contents of the file. The strings were written exactly as specified, including only the newline characters that were explicitly given.

    In[5]:=

    {arbitrary output, more output}
    yet more output



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.