Summary
delete-file and delete-file* inconsistency
Metadata
- Id: 061ac322a6f09b683eacb815e803409d88238d7d
- Trac id: 1863
- Type: defect
- Reporter: fa11-1eaf
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty: trivial
- Resolution: fixed
- Priority: minor
- Milestone: someday
- Version: 5.3.0
- Changetime: 2026-08-03 14:02:23 UTC
- Created: 2026-01-01 09:53:46 UTC
- Keywords: delete-file delete-file* file-exists stat lstat
Description
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 a research which showed me that file-exists? on 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"))'
Changes and comments
[2026-08-03 14:02:23 UTC] felix wrote:
This has been fixed in C6