Re: REPLY: pathname with tilde and wildcard characters

steve gonedes <[email protected]>
Newsgroups gmane.lisp.steel-bank.general
Message-ID <[email protected]>
On 6/5/24 5:21 PM, Peter Münster 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,


The pathname interface was never finished. it is a good place to start 
but each operating system will be different. It seems like it would be 
easy, then you have windows \\ ; and then somone said, "What about my VAX".

so much for simple.

(directory "~/common-lisp/**/*.lisp")

CL-USER> (directory "~/")
    (#P"/home/steve/")
CL-USER> (directory "~/*")
    (#P"/home/steve/.CubicSDR/" #P"/home/steve/.Xauthority" 
#P"/home/steve/.asc" #P"/home/steve #P"/home/steve/.bash_profile" 
#P"/home/steve/.bashrc" #P"/home/steve/.cache/" #P"/home/steve/.config/" 
#P"/home/steve/common-lisp/" #P"/home/steve/dwhelper/" 
#P"/home/steve/eBooks/" #P"/home/steve/src/")

CL-USER> (directory "~/**/")

CL-USER> (directory "~/common-lisp/**/*.lisp")

I think franz (acl) had some of the best ideas; such as system 
translations. it usually looks like this.

#p"sys:src;code;this.lisp"


check the documentation for CMUCL under pathnames. i would recommend 
following ACL.

the most interesting thing with pathnames is the device. no one could 
agree. too many systems.

Substituting the string is probably the best way.  I would would 
recommend creating a system-interface package (nickname SI) and 
following a template.


such as do we use .lisp .cl .fasl .fas? very simple to implement but 
without a common frame work...

At least they took pathnames seriously.




_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.