Ticket #1070 (closed defect: fixed)

Opened 4 years ago

Last modified 4 days ago

PROBE-FILE looks like it's not using MERGE-PATHNAMES anymore

Reported by: fare Owned by: gz
Priority: normal Milestone:
Component: Runtime (threads, GC) Version: trunk
Keywords: ITA Cc:


(setf (ccl:current-directory) #p"/tmp/")
(let ((*default-pathname-defaults* #p"/"))
  (probe-file "/etc"))
;;==> #p"/etc/" ; on CCL 1.9 15581
;;==> NIL ; on CCL 1.9 15773

Remarkably, the CLHS entry for PROBE-FILE doesn't seem to mention *DEFAULT-PATHNAME-DEFAULTS* or MERGE-PATHNAMES, unlike OPEN which at least mentions the latter and implies its use. So that makes PROBE-FILE also subtly different from OPEN (assuming OPEN is unaffected -- is it? I have tested).  http://clhs.lisp.se/Body/f_probe_.htm

In any case, this is probably a bug, and if not, a change that should be prominently documented.

Change History

comment:1 Changed 4 years ago by gz

  • Keywords ITA added

comment:2 Changed 4 years ago by gz

  • Owner set to gz
  • Status changed from new to assigned

comment:3 Changed 4 years ago by gz

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [15776]) replaced calls to native-translated-namestring with (new) defaulted-native-namestring where seemed appropriate. Fixes ticket:1070

comment:4 Changed 4 years ago by rme

In 19.2.3 ( http://www.lispworks.com/documentation/HyperSpec/Body/19_bc.htm), we read:

Except as explicitly specified otherwise, for functions that manipulate or inquire about files in the file system, the pathname argument to such a function is merged with *default-pathname-defaults* before accessing the file system (as if by merge-pathnames).

Would it make sense to look at all such (exported) functions, and ensure that they merge with *d-p-d* as appropriate? This might avoid what seems to me to be somewhat ad hoc insertions of defaulted-native-namestring. For example, I'm not sure that %create-file ought to be doing any merging.

comment:5 Changed 4 years ago by gz

Until recently, native-translated-namestring used to merge with *d-p-d*, and that's how all the file system functions used to effect the required merging. That was the original design. But native-translated-namestring was also doing double duty as the exported standalone way to get a native namestring, and in that role, merging with *d-p-d* is not appropriate. In r15744 I fixed the latter, but had forgotten about the former. r15776 just brings (most) file system functions back to the way they were before r15744, in terms of merging with *d-p-d*, just using a more explicit function name.

comment:6 Changed 4 days ago by rme

  • Milestone Clozure CL 1.9 deleted

Milestone Clozure CL 1.9 deleted

Note: See TracTickets for help on using tickets.