From: Raymond T. <to...@rt...> - 2002-02-27 14:22:56
|
>>>>> "Sam" == Sam Steingold <sd...@gn...> writes: >> * In message <4ni...@rt...> >> * On the subject of "Re: proposal: probe-file -- major behavior change" >> * Sent on 26 Feb 2002 17:44:16 -0500 >> * Honorable Raymond Toy <to...@rt...> writes: >> >> >>>>> "Sam" == Sam Steingold <sd...@gn...> writes: >> Sam> In CL, there is a big difference between a file and a directory. >> >> But a file is >> >> a named entry in a file system, having an >> implementation-defined nature. >> >> so I'm not sure what the right answer is. I can't find the glossary >> entry for directory. Sam> on unix, there is really no difference between "/etc" and "/etc/". I think on Mac OS X "ls /etc" and "ls /etc/" return 2 different answers. I can't check right now, though. I don't know if that's because of ls or because of the system. Sam> in CL, there is difference between #p"/etc" and #p"/etc/" wrt the Sam> values accessors and other functions return. Yes. >> >> So maybe someone really wants to know that /etc exists? >> Sam> so how is the user supposed to find out whether /etc is a file or Sam> directory? Sam> both CLISP and CMUCL have non-portable ways to do that. Sam> I propose to make PROBE-FILE useable for that. >> >> I don't know. If CL doesn't specify a way to tell if /etc is a file >> or directory, whatever you do is non-portable, so you might as well >> make it non-portable. Sam> I prefer the occam's razor - do not multiply entities unnecessarily. Sam> if PROBE-FILE can be made to differenciate between the two, why invent Sam> a separate function? Well, I think Occam's razor goes both ways here. PROBE-FILE should do just one thing. :-) If you think this is the right thing to do, it's ok. It's non-portable, but for pragmatic reasons I'd make probe-file work the same way as other CL systems do, assuming there's some consistency. On a side note, this gets an error: (with-open-file (s #p"/etc" :direction :input :element-type '(unsigned-byte 8)) (let ((d (make-array 256 :element-type '(unsigned-byte 8)))) (read-sequence d s))) whether I use /etc or /etc/ (but different errors). Am I not allowed to open a directory even on a system (Solaris) that lets me do that? CMUCL reads it in ok. Ray |