"Ben Holm" <benbelly@...> writes:
> I'm running SBCL 1.0 on Windows XP and I'm having a weird problem
> ;; This works fine
> * (with-open-file (outstream "outfile.tmp" :direction :output)
> (sb-ext:run-program "c:\\Program Files\\Perforce\\P4.exe" '() :output
> ;; This hangs forever
> * (with-output-to-string (outstream) (sb-ext:run-program "c:\\Program
> Files\\Perforce\\p4.exe" '() :output outstream))
> I searched the archives to see if this was expected behavior / a known
> bug, but I didn't see anything. Any thoughts?
Expected yes, and a sort of bug -- or at least a rather serious shortcoming.
The system sets up a handler the read from the pipe connected to the program,
and copy the data to the string-stream. However, the handler-code doesn't
work properly on Windows as of yet (shades of select(2)), so the pipe gets
full and the writing end eventually blocks.
Fixing this will require rather extensive stream work, which is
partially done in my local tree, but much remains to be done.
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."