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

Bug #968837 reported by Stas Boukarev
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

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.

Revision history for this message
Stas Boukarev (stassats) wrote :

Didn't test it on Windows.

tags: added: review
Revision history for this message
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.

(sb-ext:run-program
  "C:/msys/1.0/bin/cat.exe"
  nil
  :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.

(SB-IMPL::GET-DESCRIPTOR-FOR
 #<SB-IMPL::STRING-INPUT-STREAM {25010059}>
 (0)
 :DIRECTION
 :INPUT
 :IF-DOES-NOT-EXIST
 NIL
 :EXTERNAL-FORMAT
 :DEFAULT
 :WAIT
 T)

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.