findfile
(findfile filename [condition])
The findfile function searches for the file specified by filename and returns the complete name including drive and directory path.
- If condition = nil:
Search for a file in a certain order. The function returns a complete file name (including drive and path) of the file found first in the (application) search path. It returns nil, if no file has been found.
- If condition = T:
The function returns a list of file names in the specified or in the current drive/path.
Note:
- the list of file names is not sorted
- a path name is not returned
The order in which the function browses directories to find the specified file is as follows:
- Current directory
- Drawing directory as specified with the Options command under File Locations > Drawing Support > Drawing Files Location. Use (getenv "CADDWG") to determine the drawing folder.
- Support Files search path as specified with the Options command under File Locations > System > Support Files Search Path. Use (getenv "CADSUP") to determine the support files path.
: (findfile "C:\\Home\\Sample\\*.dwg" T)
("1.dwg" "prototype.dwg" "NONAME_0.dwg")
: (findfile "ANTIVIRUS.EXE")
"D:\\Program Files\\AntiVirus\\ANTIVIRUS.EXE"
getfiled