We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FYI, nim v2 broke createPipe
createPipe
bug: nim-lang/Nim#23118
repro
import os, asyncdispatch, winlean # import asynctools/asyncproc # # proc main()= # # let cmd = "nim -v" # let p = cmd.startProcess(options = {poStdErrToStdOut, poUsePath, poEvalCommand}) # # let exitCode = waitFor p.waitForExit() # quit exitCode # # main() const pipeHeaderName = r"\\.\pipe\asyncpipe_" const DEFAULT_PIPE_SIZE = 65536'i32 FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000'i32 PIPE_WAIT = 0x00000000'i32 PIPE_TYPE_BYTE = 0x00000000'i32 PIPE_READMODE_BYTE = 0x00000000'i32 ERROR_PIPE_CONNECTED = 535 ERROR_PIPE_BUSY = 231 ERROR_BROKEN_PIPE = 109 ERROR_PIPE_NOT_CONNECTED = 233 proc QueryPerformanceCounter(res: var int64) {.importc: "QueryPerformanceCounter", stdcall, dynlib: "kernel32".} proc createPipe() = var number = 0'i64 var pipeName: WideCString var pipeIn: Handle var pipeOut: Handle var sa = SECURITY_ATTRIBUTES(nLength: sizeof(SECURITY_ATTRIBUTES).cint, lpSecurityDescriptor: nil, bInheritHandle: 1) while true: QueryPerformanceCounter(number) let p = pipeHeaderName & $number pipeName = newWideCString(p) var openMode = FILE_FLAG_FIRST_PIPE_INSTANCE or FILE_FLAG_OVERLAPPED or PIPE_ACCESS_INBOUND var pipeMode = PIPE_TYPE_BYTE or PIPE_READMODE_BYTE or PIPE_WAIT pipeIn = createNamedPipe(pipeName, openMode, pipeMode, 1'i32, DEFAULT_PIPE_SIZE, DEFAULT_PIPE_SIZE, 1'i32, addr sa) if pipeIn == INVALID_HANDLE_VALUE: let err = osLastError() if err.int32 != ERROR_PIPE_BUSY: raiseOsError(err) else: break var openMode = (FILE_WRITE_DATA or SYNCHRONIZE) pipeOut = createFileW(pipeName, openMode, 0, addr(sa), OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0) if pipeOut == INVALID_HANDLE_VALUE: let err = osLastError() discard closeHandle(pipeIn) raiseOsError(err) createPipe()
The text was updated successfully, but these errors were encountered:
fix asyncpipe on windows
fc073b2
closes cheatfate#50
Successfully merging a pull request may close this issue.
FYI, nim v2 broke
createPipe
bug: nim-lang/Nim#23118
repro
The text was updated successfully, but these errors were encountered: