You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacBook环境下Common Lisp创建含方括号文件名的文件报错问题求助

MacBook环境下Common Lisp创建含方括号文件名的文件报错问题求助

我最近在把一个用于读写xlsx文件的Racket包移植到Common Lisp,结果遇到了个头疼的问题。大家都知道Excel文件其实就是一堆符合严格规范的XML文件打包成的压缩包,里面必须要有一个[Content_Types].xml(偶尔也会是[Content_type].xml)的文件。

我试着在MacBook上生成这个带方括号的文件,写了下面这段代码:

(defparameter *zip-xlsx-temp-directory* "test-directory/")
(defparameter *content-type-file* (merge-pathnames "[Content_Types].xml" *zip-xlsx-temp-directory*))
(with-open-file (stream (ensure-directories-exist *content-type-file-1*)
                        :direction :output
                        :if-does-not-exist :create
                        :if-exists :supersede)
  (format stream ""))

结果直接报了错,错误信息如下:

bad place for a wild pathname
[Condition of type SB-INT:SIMPLE-FILE-ERROR]

Restarts:
0: [RETRY] Retry SLY interactive evaluation request.
1: [*ABORT] Return to SLY's top level...

有没有大佬能帮我看看这问题出在哪,该怎么解决呀?

备注:内容来源于stack exchange,提问作者Gwang-Jin Kim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 07:13:13