getFileNamesLocal()

The function searches for files recursive and relative to the project path.

Synopsis

dyn_string getFileNamesLocal(dyn_string dsDirectories, string pattern = "*", dyn_string dsProjNames = makeDynString());

Parameters

Parameter Meaning
dsDirectories Project sub directories to search in.
pattern

File pattern used for searching file names. The default value is all ("*"). Pattern is case-sensitive also for Windows platform. Pattern is only applied to file names, not directory names.

Example for search either *.pnl or *.xml: *.[px][nm][l] (would also find *.pml;*.xnl etc.) since "one" of the characters in square brackets is searched. For details, see patternMatch().

dsProjNames List of project names (project + sub projects) to search for files. If omitted, then all projects are searched. If you do not specify a project name, the function returns the files from the current project and from the WinCC OA version.

Return value

The function returns a list of file names.

Description

The function searches for files recursive and relative to the project path. For debug messages use the STD_FILEOP debug flag. For how to use debug flags, see chapter Console panel.

Example

The following example returns the files of the "log" directory in the project "WinCCOA_Proj ".

  1. main(mapping event)
    
    
    {
    
    
      dyn_string dir = makeDynString("log");
    
    
      dyn_string projName = makeDynString("WinCCOA_Proj");
    
    
      dyn_string retVal;
    
    
      string pat;
    
    
      retVal=getFileNamesLocal(dir, pat, projName);
    
    
      DebugN("Files:", retVal);
    
    
    }

Assignment

File function

Availability

CTRL, UI