wanted: run-program stream option completeness

Bug #789817 reported by Nikodemus Siivola on 2011-05-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

There's no way to say :IF-OUTPUT-DOES-NOT-EXIST :ERROR -- which also somewhat obfuscates that the default is to create the file if it does not exist.

Similarly for error.

:IF-INPUT-DOES-NOT-EXIST :CREATE seems really odd. What's the use-case? I could understand :IF-INPUT-DOES-NOT-EXIST :CREATE-NAMED-PIPE...

pipping (pipping) wrote :

Assuming that `open` is used and these options are passed through in the obvious way, I would not expect such a new flag to be necessary. The difference between :if-output-exists :overwrite and :if-output-exists :supersede would be exactly that the former should also have an effect like :if-output-does-not-exist :error, no? That's my understanding of http://clhs.lisp.se/Body/f_open.htm

You get to set

 :if-output-exists :overwrite -> :error if it does not exists
 :if-output-exists :supersede -> :create if it does not exist
 :if-output-exists :append -> :error if it does not exist
 :if-output-exists :error -> :create if it does not exist

I think those four cases cover everything that one would want, no?

pipping (pipping) wrote :

I missed an important case that invalidates my argument and suggests that something could indeed be improved here: I think you would typically want to open a log file with

  :direction :output
  :if-exists :append
  :if-does-not-exist :create

Meanwhile, run-program's :if-output-exists :append would give you the effect of :if-does-not-exist :error for the output file, and there's currently no way to change that.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers