run-program with :if-ouput-exists :append assumes existing file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
* (run-program "/bin/rm" '("/tmp/test"))
#<SB-IMPL::PROCESS :EXITED 0>
* (run-program "/bin/cat" '("/etc/passwd") :output "/tmp/test" :if-output-exists :append)
debugger invoked on a FILE-DOES-NOT-EXIST in thread
#<THREAD "main thread" RUNNING {1004A18433}>:
The file #P"/tmp/test" does not exist: No such file or directory
restarts (invokable by number or by possibly-
0: [CREATE ] Reopen with :if-does-not-exist :create
1: [CONTINUE ] Retry opening.
2: [USE-VALUE] Try opening a different file.
3: [ABORT ] Exit debugger, returning to top level.
(SB-IMPL:
0] 0
#<SB-IMPL::PROCESS :EXITED 0>
* (run-program "/bin/cat" '("/etc/passwd") :output "/tmp/test" :if-output-exists :append)
#<SB-IMPL::PROCESS :EXITED 0>
*
Solution: Add :if-does-not-exist :create, when opening the output file in append mode.
SBCL 2.1.4.129.
Changed in sbcl: | |
status: | New → Fix Committed |
assignee: | Ingo Krabbe (ikrabbe-ask) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
The patch is a git diff taken from the current master