mes: Add dirname.
* module/mes/guile.mes (dirname): New function.
This commit is contained in:
parent
08562b168d
commit
244d11a2af
|
@ -149,3 +149,8 @@
|
|||
(set! set-current-input-port save-set-current-input-port)
|
||||
string-port)))))))
|
||||
string-port)))
|
||||
|
||||
(define (dirname file-name)
|
||||
(let ((lst (filter (negate string-null?) (string-split file-name #\/))))
|
||||
(if (<= (length lst) 1) "."
|
||||
(string-join (list-head lst (1- (length lst))) "/"))))
|
||||
|
|
Loading…
Reference in a new issue