unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#34860: Probing broken symlinks always involves errors
@ 2019-03-14 19:50 Tim Gesthuizen
  2019-04-10 19:22 ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Gesthuizen @ 2019-03-14 19:50 UTC (permalink / raw)
  To: 34860

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-30 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 19:50 bug#34860: Probing broken symlinks always involves errors Tim Gesthuizen
2019-04-10 19:22 ` Mark H Weaver
2019-04-11 18:05   ` Tim Gesthuizen
2019-06-30 19:54     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).