Feature request: Use temp file when superseding file

Bug #1934664 reported by Pierre Neidhardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

In https://old.reddit.com/r/Common_Lisp/comments/o1zw50/reliable_file_write_via_temp_file/ it's pointed out that CCL automatically writes to a temp file when superseding a file with `(open ... :if-exists :supersede)`.

See this example: https://old.reddit.com/r/Common_Lisp/comments/o1zw50/reliable_file_write_via_temp_file/h43tfy8/

This is very useful in case of errors: the original file gets restored and thus we don't end up compromising the file integraty. Would be nice if SBCL did this as well.

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

What happens when you run out of space because of that?

Revision history for this message
Pierre Neidhardt (ambrevar) wrote : Re: [Bug 1934664] Re: Feature request: Use temp file when superseding file

Good question.

I had a look at the doc, no rationale seems to be given:
https://ccl.clozure.com/docs/ccl.html#streams

So I looked at the source. `open` calls to `make-file-stream`, but
there is no comment or documentation there as to why they create a temp
file and how they deal with full file systems.

So I guess this is an unresolved problem with CCL.

Revision history for this message
Pierre Neidhardt (ambrevar) wrote :

Good question.

I had a look at the doc, no rationale seems to be given:
https://ccl.clozure.com/docs/ccl.html#streams

So I looked at the source. `open` calls to `make-file-stream`, but
there is no comment or documentation there as to why they create a temp
file and how they deal with full file systems.

So I guess this is an unresolved problem with CCL.

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

Other bug subscribers