GNU bug report logs - #34860
Probing broken symlinks always involves errors

Previous Next

Package: guile;

Reported by: Tim Gesthuizen <tim.gesthuizen <at> yahoo.de>

Date: Thu, 14 Mar 2019 19:56:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tim Gesthuizen <tim.gesthuizen <at> yahoo.de>
To: 34860 <at> debbugs.gnu.org
Subject: bug#34860: Probing broken symlinks always involves errors
Date: Thu, 14 Mar 2019 20:50:57 +0100
Hi,
I wrote a little application that tries to probe whether a symlink
exists. The `stat` function has an undocumented optional parameter that
lets stat return #f when the file does not exist. With this argument one
can probe for any files excluding broken symlinks.
lstat does not offer this argument. Therefore I needed to use
guard-expressions around lstat to probe for broken symlinks.

So probing broken symlinks relies on errors in the control flow and is
not straight forward. Maybe we should add the optional argument that
`stat` has and document the arguments for both commands.

I am using guile 2.2.4.

Tim.




This bug report was last modified 5 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.