run-program requires /tmp/ to exists for input streams

Bug #968837 reported by Stas Boukarev on 2012-03-30
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

(with-input-from-string (string "string")
  (sb-ext:run-program "/bin/cat" '() :input string :output *standard-output*))

Creates a temporary file /tmp/.run-program-XXXXXX, /tmp/ directory might not exist on all systems, especially on Windows.

Stas Boukarev (stassats) wrote :

Didn't test it on Windows.

tags: added: review
NeedMoreDesu (desu) wrote :

I'm running it on SBCL 1.0.55 under windows7.
It still errors, but now in another place. I think it's 963 line in run-program.lisp, but I don't know how to fix it correctly.

  :input (make-string-input-stream "It's my string")
  :output t
  :error t)

  debugger invoked on a SIMPLE-ERROR:
  failed to unlink C:\Users\DESUDE~1\AppData\Local\Temp/.run-program-a05656

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.


Stas Boukarev (stassats) wrote :

commit 43c193e2c20ce746c6c4d23d25ceba4d192c7d15
Author: Stas Boukarev <email address hidden>
Date: Tue May 22 22:39:07 2012 +0400

    run-program: Don't use /tmp unconditionally.

    * Use TEMP on win32 and TMPDIR on non-win32.
    * Don't delete just opened temporary files on windows, because opened
      files cannot be unlinked on windows

Changed in sbcl:
status: Triaged → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers