Steel Bank Common Lisp

OPEN fails with :IF-EXISTS :NEW-VERSION

Reported by Leslie P. Polzer on 2009-10-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

% touch /tmp/foo
% sh run-sbcl.sh --no-userinit --no-sysinit
(running SBCL from: /home/sky/sbcl.git.dev)
This is SBCL 1.0.31.32, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (open "/tmp/foo" :direction :output :if-exists :new-version)

debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread #<THREAD "initial thread" RUNNING {A984909}>:
  error opening #P"/tmp/foo": File exists

This is intentional: since we don't support pseudo-versioned pathnames and unix doesn't provide real ones, we rahter signal an error than do something lossy.

The error message should be better, though, and explain the situation.

From CLHS: "The various file systems in existence today have widely differing capabilities, and some aspects of the file system are beyond the scope of this specification to define. A given implementation might not be able to support all of these options in exactly the manner stated. An implementation is required to recognize all of these option keywords and to try to do something ``reasonable'' in the context of the host file system. Where necessary to accomodate the file system, an implementation deviate slightly from the semantics specified here without being disqualified for consideration as a conforming implementation. If it is utterly impossible for an implementation to handle some option in a manner similar to what is specified here, it may simply signal an error."

While this bug has been marked as confirmed, I would consider it fixed once the error message tells what is actually going on.

Cheers,

 -- Nikodemus

 status confirmed
 priority low
 tag streams documentation

Nikodemus Siivola (nikodemus) wrote :

This is intentional: since we don't support pseudo-versioned pathnames and unix doesn't provide real ones, we rather signal an error than do something lossy.

The error message should be better, though, and explain the situation.

From CLHS: "The various file systems in existence today have widely differing capabilities, and some aspects of the file system are beyond the scope of this specification to define. A given implementation might not be able to support all of these options in exactly the manner stated. An implementation is required to recognize all of these option keywords and to try to do something ``reasonable'' in the context of the host file system. Where necessary to accomodate the file system, an implementation deviate slightly from the semantics specified here without being disqualified for consideration as a conforming implementation. If it is utterly impossible for an implementation to handle some option in a manner similar to what is specified here, it may simply signal an error."

While this bug has been marked as confirmed, I would consider it fixed once the error message tells what is actually going on.

Cheers,

  -- Nikodemus

 status confirmed
 importance low
 tag streams documentation

Changed in sbcl:
importance: Undecided → Low
tags: added: review
Philip Munksgaard (pmunksgaard) wrote :

Here is a(nother) patch that gives a more descriptive error message when using :new-version.

Paul Khuong (pvk) wrote :

Committed a minimally tweaked version as 1c0ce8a (More meaningful error message for OPEN :IF-EXISTS :NEW-VERSION). Thank you!

Changed in sbcl:
status: Confirmed → 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