[Ecls-list] Merge DELETE-FILE and RMDIR?

Mark Cox markcox80 at gmail.com
Thu Oct 13 12:06:37 UTC 2011


Hi Juanjo,

On 13/10/2011, at 6:48 PM, Juan Jose Garcia-Ripoll wrote:

> On Thu, Oct 13, 2011 at 1:24 AM, Mark Cox <markcox80 at gmail.com> wrote:
> I have two issues with respect to the merging of DELETE-FILE and
> RMDIR:
> 
> 1. For physical pathnames it seems straightforward, but I do
> wonder if there are any unexpected gotchas when using logical
> pathnames.
> 
> Understood, but here the user must understand that logical pathnames are not physical objects. An invalid pathname translation also has problems with delete-files, as it would do one that changes a file into a directory and viceversa.
> 
> 2. DELETE-FILE is defined by the CLHS. People who use ECL without
> reading too much of the CLHS may expect DELETE-FILE to behave
> similarly across implementations. For example, it was a huge shock to
> me that in CLISP, PROBE-FILE signals an error when called with a
> pathname that represents a directory.
> 
> This is a different field. So far no implementation has restrained from having unspecified behavior because ECL users might be confused, and this includes incorrect LOOP forms, but this is not the case. As Waldek pointed out, the key point is the definition of file (http://clhs.lisp.se/Body/26_glo_f.htm#file), which talks about a named entry in the file system. If ECL already considers directories to be valid files for PROBE-FILE, then it is inconsistent in not allowing to delete them, and failing to rename them for some fo the syntaxes.

I agree that DELETE-FILE should be able to delete directories. I was merely raising concerns with the change. The fact that ENSURE-DIRECTORIES-EXIST has no ENSURE-DIRECTORIES-DO-NOT-EXIST suggests to me that DELETE-FILE was intended all along to have that capability anyhow. I probably should have stated this in my first email.

Thanks for the link to the term file. It is interesting that the "Arguments and Values" section for PROBE-FILE and DELETE-FILE specify pathname designator [1] rather than file.
This gives the impression that you could delete/probe a pathname host or device. It is not until the description do you see any mention of the term file. I guess now it is down to what you consider to be "in" a file system. 

Ah, the fun.

Mark

[1] http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_p.htm#pathname_designator


This excursion has lead to the discovery of ENOUGH-NAMESTRING, something I have always done by hand. Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20111013/ddecb702/attachment.html>


More information about the ecl-devel mailing list