guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: utils: Add 'symbolic-link?'.


From: Ludovic Courtès
Subject: 02/03: utils: Add 'symbolic-link?'.
Date: Mon, 01 Dec 2014 15:52:12 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit 9741aca9a586231423712b99d52346bf3dcdd4e3
Author: Ludovic Courtès <address@hidden>
Date:   Mon Dec 1 15:46:10 2014 +0100

    utils: Add 'symbolic-link?'.
    
    * guix/build/utils.scm (symbolic-link?): New procedure.
---
 guix/build/utils.scm |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 737976e..de1cfce 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -35,6 +35,7 @@
 
             directory-exists?
             executable-file?
+            symbolic-link?
             call-with-ascii-input-file
             elf-file?
             ar-file?
@@ -93,6 +94,10 @@
     (and s
          (not (zero? (logand (stat:mode s) #o100))))))
 
+(define (symbolic-link? file)
+  "Return #t if FILE is a symbolic link (aka. \"symlink\".)"
+  (eq? (stat:type (lstat file)) 'symlink))
+
 (define (call-with-ascii-input-file file proc)
   "Open FILE as an ASCII or binary file, and pass the resulting port to
 PROC.  FILE is closed when PROC's dynamic extent is left.  Return the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]