yu960312 发表于 2022-5-10 08:47:35

lisp如何判断文件/文件夹是否存在???

如题 lisp如何判断文件/文件夹是否存在???

vectra 发表于 2022-5-10 09:52:12

vl-directory-files


Lists all files in a given directory

(vl-directory-files)
Arguments

directory
A string naming the directory to collect files for; if nil or absent, vl-directory-files uses the current directory.

pattern
A string containing a DOS pattern for the file name; if nil or absent, vl-directory-files assumes “*.*”

directories
An integer that indicates whether the returned list should include directory names. Specify one of the following:

-1 List directories only.

0 List files and directories (the default).

1 List files only.

Return Values

A list of file and path names; otherwise nil if no files match the specified pattern.

Examples

_$ (vl-directory-files "c:/acadwin"
"acad*.exe")
("ACAD.EXE" "ACADAPP.EXE" "ACADL.EXE" "ACADPS.EXE")
_$ (vl-directory-files "e:/acadwin"
nil -1)
("." ".." "SUPPORT" "SAMPLE" "ADS" "FONTS" "IGESFONT" "SOURCE" "ASE")
_$ (vl-directory-files "E:/acad13c4"
nil -1)
("." ".." "WIN" "COM" "DOS")

yu960312 发表于 2022-5-10 21:46:59

vectra 发表于 2022-5-10 09:52
vl-directory-files




感谢大哥,学习了
页: [1]
查看完整版本: lisp如何判断文件/文件夹是否存在???