Share

acedFindFile

C++

ACCORE_PORT int acedFindFile(
    const ACHAR * fname, 
    AcString & sResult
);

File

acedads.h

Description

Searches for the specified file.

The result argument must point to a buffer large enough to hold the qualified file name: depending on the directory structure of the current environment, this can be quite long. The maximum length of result is platform dependent. On platforms that restrict file-name length, it is 78 characters; on platforms that don't restrict file-name length, it is 511.

This function makes no assumption about the type of the file, and does not attempt to append any kind of file-name extension. If the file you are searching for does have an extension to its name, the extension must be included in the fname argument.

If fname is qualified by including a drive or directory prefix (for example, "d:test.exp"), acedFindFile() searches only that disk or directory. Otherwise, acedFindFile() searches for fname according to the current AutoCAD library path, which consists of the following directories, in order:

  1. The current directory
  2. The directory that contains the current drawing file
  3. The directories named by the ACAD environment variable (if this variable has been specified)
  4. The directory that contains the AutoCAD program files

Depending on the current environment, two or more of these directories may be the same.

If acedFindFile() finds the file, it returns RTNORM; otherwise, it returns RTERROR.

Parameters

Parameters Description
fname File name to search for
sResult Output value of the file name and path

Returns

Fully qualified path name of the file, if it was found.

Was this information helpful?