Re: pathname with tilde and wildcard characters
Stas Boukarev <[email protected]>
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <CAF63=13YHRPr5EN9De2KVN64kPix0wHpVRn0An9UeL6vUmJCeQ@mail.gmail.com> |
(let ((native (parse-native-namestring "~/foo.lisp")))
(if (eql (search '(:relative "~") (pathname-directory native) :test
#'equal) 0)
(make-pathname :directory (list* :absolute :home (subseq
(pathname-directory native) 2))
:defaults native)
native))
On Thu, Jun 6, 2024 at 12:27 AM Peter Münster <[email protected]> wrote:
> Hi,
>
> What would be the best method, to open a file with "~/" (for the home
> directory) and wildcard characters in its name please?
>
> I’ve tried (open "~/tmp/test-??-file") and
> (open (parse-native-namestring "~/tmp/test-??-file")), but both result
> in errors.
>
> Of course, I could parse the string and translate "~/" or the wildcard
> characters. But I would like to know, if there is already a better
> solution in SBCL.
>
> TIA for any help,
> --
> Peter
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>
_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help