Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen(tempname()) fails on Windows #20617

Closed
TeroFrondelius opened this issue Feb 15, 2017 · 3 comments
Closed

listen(tempname()) fails on Windows #20617

TeroFrondelius opened this issue Feb 15, 2017 · 3 comments
Labels
docs This change adds or pertains to documentation system:windows Affects only Windows

Comments

@TeroFrondelius
Copy link
Contributor

Linux:

julia> listen(tempname())
Base.PipeServer(active)

julia> 

Windows:

julia> listen(tempname())
ERROR: ArgumentError: could not listen on path \AppData\Local\Temp\jl_ADD1.tmp
 in listen(::String) at .\stream.jl:944

julia>

Both with version v"0.5.0"

Documentation propose this should work also in Windows: http://docs.julialang.org/en/stable/manual/networking-and-streams/#a-simple-tcp-example

julia> listen("testsocket") # Listens on a UNIX domain socket/named pipe
PipeServer(active)

Note that the return type of the last invocation is different. This is because this server does not listen on TCP, but rather on a named pipe (Windows) or UNIX domain socket.

@tkelman
Copy link
Contributor

tkelman commented Feb 15, 2017

probably related: #9053

@vtjnash vtjnash added the docs This change adds or pertains to documentation label Feb 15, 2017
@vtjnash
Copy link
Member

vtjnash commented Feb 15, 2017

Windows doesn't support arbitrary paths, it requires that they conform to a specific pattern such that their name prefix (\\.\pipe\) uniquely identifies the filetype: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365783(v=vs.85).aspx

@TeroFrondelius
Copy link
Contributor Author

Thanks @vtjnash this works:

julia> server = listen("\\\\.\\pipe\\lintserver7632sKFV0Qsock")
Base.PipeServer(active)

julia>

I think the documentation needs a small update. Maybe one Windows example? I guess this cannot be a doctest, because it would be Windows only?

How about adding a new function: tempsocket() or tempnamedpipe()? Which would return correctly named pipe with random temporyname for Windows and tempname() for Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

3 participants