changeset 698: |
96958d3eb5b0 |
parent: |
926d95e5fdc7
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 ;;; std/path.lisp --- Standard Path Library 8 (defun symlinkp (pathname) 9 (sb-posix:s-islnk (sb-posix:stat-mode (sb-posix:lstat pathname)))) 11 (deftype wild-pathname () 12 "A pathname with wild components." 13 '(and pathname (satisfies wild-pathname-p))) 15 (deftype non-wild-pathname () 16 "A pathname without wild components." 17 '(or directory-pathname 18 (and pathname (not (satisfies wild-pathname-p))))) 20 (deftype absolute-pathname () 21 '(and pathname (satisfies uiop:absolute-pathname-p))) 23 (deftype relative-pathname () 24 '(and pathname (satisfies uiop:relative-pathname-p))) 26 (deftype directory-pathname () 27 '(and pathname (satisfies uiop:directory-pathname-p))) 29 (deftype symlink-pathname () 30 '(and pathname (satisfies symlinkp))) 32 (deftype absolute-directory-pathname () 33 '(and absolute-pathname directory-pathname)) 35 (deftype file-pathname () 36 '(and pathname (satisfies uiop:file-pathname-p))) 38 ;; logical-pathname is defined in CL. 40 (defconstant +pathsep+ 41 #+windows #\; #+unix #\: 42 "Path separator for this OS.") 44 (defconstant +wildfile+ (make-pathname :name :wild :type :wild :version :wild)) 46 ;; from UIOP:ADD-PATHNAME-SUFFIX 47 (defun set-pathname-suffix (path suffix &rest keys) 48 (apply 'make-pathname :name (concatenate 'string (pathname-name path) suffix) 51 (defvar *tmp-suffix* "-tmp") 53 ;; based on UIOP:TMPIZE-PATHNAME 54 (defun tmpize-pathname (path) 55 "Return a new pathname based on PATH and *TMP-SUFFIX* with a gensym'd integer 57 (set-pathname-suffix path (symbol-name 58 (gensym *tmp-suffix*))))