From b1a749ca8cf7dd1f49d8c79f7c65e0ec4e876747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 24 Apr 2022 01:56:12 +0200 Subject: Introduce filename-extension procedure. --- module/hnh/util/path.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/hnh') diff --git a/module/hnh/util/path.scm b/module/hnh/util/path.scm index 0aa747d0..49b53897 100644 --- a/module/hnh/util/path.scm +++ b/module/hnh/util/path.scm @@ -57,3 +57,6 @@ (define base (basename path)) (and (not (string-null? base)) (char=? #\. (string-ref base 0)))) + +(define-public (filename-extension filename) + (car (reverse (string-split filename #\.)))) -- cgit v1.2.3