unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
To: 34860@debbugs.gnu.org
Subject: bug#34860: Probing broken symlinks always involves errors
Date: Thu, 14 Mar 2019 20:50:57 +0100	[thread overview]
Message-ID: <87ef79z13y.fsf@yahoo.de> (raw)

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.





             reply	other threads:[~2019-03-14 19:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 19:50 Tim Gesthuizen [this message]
2019-04-10 19:22 ` bug#34860: Probing broken symlinks always involves errors Mark H Weaver
2019-04-11 18:05   ` Tim Gesthuizen
2019-06-30 19:54     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ef79z13y.fsf@yahoo.de \
    --to=tim.gesthuizen@yahoo.de \
    --cc=34860@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).