例如,我有一堆这样的文件名:
[foo
我正在编写一些代码来收集它们并对其进行一些处理。
(setf a (car (uiop:directory-files "/path/to/dir")));;for simplicity
;;we suppose there is only a [foo at /path/to/dir
(uiop:run-program (list "cat" (namestring a)));; cat is just an example
然后它说:
Subprocess #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {1009C93CA3}>
with command ("cat" "/path/to/dir/\\[foo")
exited with error code 1
虽然(uiop:run-program (list "cat" "/path/to/dir/\[asd"))
看起来不错。
我也尝试过这样的事情:
(format NIL "~A" a)
(format NIL "~S" temp)
(princ-to-string temp)
那么如何使用正确的路径名调用 run-program 呢?