LinkWrite[link,expr]
writes expr to the specified WSTP connection.
LinkWrite
LinkWrite[link,expr]
writes expr to the specified WSTP connection.
Details
- link must be an active LinkObject, as returned by functions like LinkLaunch or Links.
- You can use LinkWrite[link,Unevaluated[expr]] to write expr to the link without evaluating it.
- The head of expr will often be a packet that specifies how expr should be processed by the program which receives it.
- When LinkWrite is used to send data to a Wolfram Language kernel, EnterTextPacket["string"] enters the text of an input line, and EvaluatePacket[expr] sends an expression for evaluation.
Examples
Basic Examples (1)
Launch a subsidiary Wolfram Language kernel process:
link = LinkLaunch[First[$CommandLine] <> " -wstp"]LinkRead[link]Write the expression 2+2 to the link without evaluating it:
LinkWrite[link, Unevaluated[2 + 2]]LinkRead[link]LinkClose[link]See Also
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), LinkWrite, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkWrite.html.
CMS
Wolfram Language. 1996. "LinkWrite." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LinkWrite.html.
APA
Wolfram Language. (1996). LinkWrite. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinkWrite.html
BibTeX
@misc{reference.wolfram_2026_linkwrite, author="Wolfram Research", title="{LinkWrite}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/LinkWrite.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linkwrite, organization={Wolfram Research}, title={LinkWrite}, year={1996}, url={https://reference.wolfram.com/language/ref/LinkWrite.html}, note=[Accessed: 13-June-2026]}