Copies all (non-hidden) files contained in the specified source directory to the specified destination directory.

This function may be particularly useful to copy certain external files associated with the generated documentation (e.g. images). See also GOMOutputInfo.inputFilesPath generator property for that matter.

Parameters:

srcDir

The file pathname of the source directory.

If the pathname is not an absolute one, it is resolved against the current system directory. The allowed name-separator character may be '/' or '\'.

When the specified pathname is null or empty string or the source directory does not exist, the function does nothing.

dstDir
The file pathname of the destination directory.

If the provided pathname is not an absolute one, it is resolved against the current system directory. The allowed name-separator character may be '/' or '\'.

When this parameter is null or empty string, the function does nothing.

If the destination directory does not exist, it will be created including any necessary but nonexistent parent directories.

If the destination directory already exists, anything contained in it will remain except the files whose names are equal to the names of the copied files. Such files which will be overwritten.

recursive
This parameter enables deep copying of the source directory. When it is true, all subdirectories and their contents are recursively copied to the destination directory.

When this parameter is absent, it is assumed to be false.

excludeSubdirs
When the deep copying is enabled, this parameter may specify an array containing names of those subdirectories that must be excluded from any copying.

The null parameter value (or empty array) will mean no excluded names are specified.

Returns:

The number of copied files (see also the notice below).

Notice:

The generator tracks each call of the copyFiles() function so that for each set of parameters:

{ srcDir (as absolute pathname);
  dstDir (as absolute pathname);
  recursive;
  excludeSubdirs }
the actual file copying is executed only once. This helps to avoid multiple copying of the same files, particularly when the copyFiles() function is called from an expression that may be repeatedly executed a number of times.

For a given set of parameters, the function always returns the same result during both the first and the subsequent "idle" calls.

See Also:

copyFile()