On Thu Jan 1, 2026 at 9:59 AM CET, Clark Brown via Chicken-hackers wrote: > While trying to delete an invalid symbolic link file (for which the linked > file is deleted), delete-file function succeeds, while delete-file* returns > false. > I have conducted research which showed me that file-exists? with such > invalid link also returns false, as it calls stat, and, therefore, follows > symbolic links. > I have prepared a patch which replaces stat with lstat. If that approach is > not acceptable, I can try to fix it in a more preferred way. > > How to reproduce: > $ touch some-file > $ ln -s some-file some-link > $ rm some-file > $ csi -e '(import (chicken file)) (print (file-exists? "some-link"))' > > P.S. I tried creating a ticket, but bugtracker responds with 500 HTTP code.
Hi! Thanks for the patch. I'm not sure how to proceed, though. I think "file-exists?" should be as portable as possible and do not perform operating-system specific stuff like symlinks, etc., so in the interest of transparency, I would say the current behaviour is the best one (until you need the opposite, of course). So I'm undecided, what do others think? There still is the posix file module that gives one full control over how symlinks are handled (or not). In any case, "delete-file*" should work like "delete-file" for dangling symlinks, in my opinion. I will prepare a patch for that. cheers, felix
