明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 665|回复: 2

[提问] lisp如何判断文件/文件夹是否存在???

[复制链接]
发表于 2022-5-10 08:47:35 | 显示全部楼层 |阅读模式
如题 lisp如何判断文件/文件夹是否存在???
发表于 2022-5-10 09:52:12 | 显示全部楼层
vl-directory-files


Lists all files in a given directory

(vl-directory-files  [directory pattern directories])
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")
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2022-5-10 21:46:59 | 显示全部楼层

感谢大哥,学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-14 14:42 , Processed in 0.217830 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表