findfile

(findfile filename [condition])

The findfile function searches for the file specified by filename and returns the complete name including drive and directory path.

  1. 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.
  2. If condition = T:

    The function returns a list of file names in the specified or in the current drive/path.

    Note:

The order in which the function browses directories to find the specified file is as follows:

  1. Current directory
  2. Drawing directory as specified with the Options command under File Locations > Drawing Support > Drawing Files Location. Use (getenv "CADDWG") to determine the drawing folder.
  3. 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.

Examples

: (findfile "C:\\Home\\Sample\\*.dwg" T)

("1.dwg" "prototype.dwg" "NONAME_0.dwg")

: (findfile "ANTIVIRUS.EXE")

"D:\\Program Files\\AntiVirus\\ANTIVIRUS.EXE"

Related Functions

getfiled