Tried to open an Out named pipe from Powershell
$pipe = new-object System.IO.Pipes.NamedPipeServerStream 'testpipe','Out'
$pipe.WaitForConnection()
$sw = new-object System.IO.StreamWriter $pipe
$sw.AutoFlush = $true
$sw.WriteLine("Server pid is $pid")
$sw.Dispose()
$pipe.Dispose()
and use Get to read the named pipe.
Get["\\\\.\\pipe\\testpipe"]
The following messages were shown in Powershell and Mathematica
Exception calling "WriteLine" with "1" argument(s): "Pipe is broken."
At line:5 char:1
+ $sw.WriteLine("Server pid is $pid")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IOException
Exception calling "Dispose" with "0" argument(s): "Pipe is broken."
At line:6 char:1
+ $sw.Dispose()
+ ~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IOException
Get::noopen: Cannot open \\.\pipe\testpipe.
LoadNETTypetwice to get the correct type. It will first throw the message thatNET::netexcptn: A .NET exception occurred: System.TypeLoadException: Type System.IO.Pipes.PipeDirection not found. at Wolfram.NETLink.TypeLoader.GetType(String typeName, String assemblyName, Boolean throwOnError) at Wolfram.NETLink.Internal.CallPacketHandler.loadType1(KernelLinkImpl ml).And everything goes fine when I execute it again. Do you know the reason? – kenkangxgwe May 13 '19 at 02:28InstallNET[]explicitly prior toLoadNETType[...]. – WReach May 13 '19 at 16:07