From: William H. N. <wil...@ai...> - 2001-06-22 17:28:56
|
On Sat, Jun 16, 2001 at 02:47:19PM +0100, Daniel Barlow wrote: > William Harold Newman <wil...@ai...> writes: > > > [I wrote] > > > The reasonable solutions I can think of are (1) replace the call to > > > (truename name) in DIRECTORY with (or (probe-file name) name), or (2) > > > change TRUENAME to only follow symlinks as far as it can see them, and > > > stop there. > > > I'm not sure it's better, but how about (3) making DIRECTORY simply > > skip dangling symlinks (and making an explicit call to TRUENAME on a > > dangling symlink signal an error)? There seems to be nothing useful > > (or at least nothing useful and unsurprising) that you can do with a > > representing a dangling symlink in the Common Lisp world, so it might > > be reasonable to ignore them. > > * You might want to delete them ;-) > > * Emacs uses dangling symlinks to manage file locking: for any file > foo.lisp that you're editing, it creates the link > > lrwxrwxrwx 1 dan dan 37 Jun 16 12:47 .#foo.lisp -> da...@no....893:992399701 > > (in fact it was through editing one of the test scripts while running > tests that I came across this bug). So, if a Common Lisp program > should want to interoperate with Emacs in this way, it needs to be > able to see them. > > * A directory cannot be deleted unless it's empty: if it contains a > dangling symlink which we don't know about, we'll get an unexpected > error when we try to delete it. So, I was eventually able to implement something like proposal (2). Note that: a. The "see all links in a directory so that you can delete the links so that you can delete the directory" rationale only works in a somewhat ugly, nonintuitive way, since in general you have to do "while CL:DIRECTORY is nonempty delete everything it reports", with a potentially unlimited number of passes, before the Unix directory is actually empty of symlinks. b. In support of the principle that Unix files, even weird symlinks, should be visible in CL:DIRECTORY and thus CL:TRUENAME, I also made TRUENAME on a cyclic symlink return the cyclic symlink itself. This stuff is checked in as sbcl-0.6.12.36 now. Anyone with an opinion on how this ought to work should probably take a look at the new code and the new test cases, since my sales resistance for proposals to change the new behavior is very low right now but will probably increase somewhat whenever I get around to releasing sbcl-0.6.13 (likely early August, but possibly earlier) and increase further when I release sbcl-0.7.0 (late August?). -- William Harold Newman <wil...@ai...> As usual, this being a 1.3.x release, I haven't even compiled this kernel yet. So if it works, you should be doubly impressed. -- Linus Torvalds, announcing kernel 1.3.3 on the linux-kernel mailing list. PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C |