[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file
From: |
Maxime Devos |
Subject: |
[bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?. |
Date: |
Thu, 07 Apr 2022 14:28:11 +0200 |
User-agent: |
Evolution 3.38.3-1 |
Andrew Tropin schreef op do 07-04-2022 om 11:22 [+0300]:
> + (define (no-follow-file-exists? file)
> + "Return #t if file exists, even if it's a dangling
> symlink."
> + (or (file-exists? file)
> + (and=> (false-if-exception (lstat file))
> + (lambda (x)
> + (equal? (stat:type x) 'symlink)))))
Can't this be simplified to
(define (no-follow-file-exists? file)
(false-if-exception (lstat file)))
? Also, do you want to ignore _all_ exceptions, or only the ENOENT and
maybe ENOTDIR system-error?
(catch 'system-error
(lambda () (lstat file) #t)
(lambda e
(if its-a-ENOFILE
#f
(apply throw e))))
More concretely, why is ENOMEM, ENAMETOOLONG and EACCESS ignored here?
Greetings,
Maxime.
signature.asc
Description: This is a digitally signed message part
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Andrew Tropin, 2022/04/07
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?.,
Maxime Devos <=
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Andrew Tropin, 2022/04/07
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Maxime Devos, 2022/04/07
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Maxime Devos, 2022/04/07
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Andrew Tropin, 2022/04/08
- bug#54762: [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Ludovic Courtès, 2022/04/09
- [bug#54762] [PATCH] home: symlink-manager: Use no-follow version of file-exists?., Andrew Tropin, 2022/04/11