The function requestFileList() requests a file list from the manager with the specified manager Id. |
Synopsis
dyn_mapping requestFileList(int manId, string | dyn_string dirs[, mapping | dyn_mapping options); |
Parameters
Parameter |
Meaning |
manId |
The manager ID. See also function convManIdToInt(). |
dirs |
The parameter dirs contains the start directory for the search. |
options |
The parameter options contains a list of options: "fromTime": time. The default value is (1.1.1970). Only includes files that are younger than specified time. "recursive": bool. The default value is TRUE. Searches directories recursive meaning whether sub directories should be included. "excludeDirs": dyn_string. The default value is empty. List of directories (with wild cards) that should not be searched through recursive (for example, */CVS/*). "allIfOneYounger": bool. The default value is false. If only one file in a directory is younger than "fromTime", all files from the directory will be returned. The option does not work recursive. "includeFiles": dyn_string. The default value is empty. A pattern to which the file names will be compared to. The files will be returned only if they correspond to the pattern. If the array is empty, all files will be considered. |
Return value
The function returns 1 when it was executed successfully and in case of errors 0. |
Errors
Missing or invalid arguments. |
Description
The function requestFileList() requests a file list from the manager with the specified manager Id. The result is an array of mappings with following values:
|
EXAMPLE
In the first example all files from the panels directory will be delivered and the time will not be restricted. In the second example the time will be restricted to a specific date and the option allIfOneYounger will be used. allIfOneYounger returns all files if only one file is younger than the specified date. |
main() { int manID; dyn_char managers; managers
= makeDynChar(CTRL_MAN); //Manager type
constant DebugN("ManagerID:",manID); dyn_string pattern; pattern = makeDynString("panels"); /*The files from the directory "panels" will be delivered. */ mapping opt; dyn_mapping l; l = requestFileList(manID, pattern, opt); /* Function call. Files from the directory "panels" will be delivered. The time will not be restricted and all directories will be delivered. */ DebugN("Detailliste:", l); int i; } |
main() { time t = setTime(t, 2010,10,04); int manID; dyn_char managers; managers = makeDynChar(CTRL_MAN); //Manager type constant manID = convManIdToInt(CTRL_MAN, 2); /*Function call with the two parameters (Manager type and Manager number. The return value is the integer that corresponds to the manager identifier */ DebugN("ManagerID:", manID); dyn_string pattern; pattern = makeDynString("panels");/* The files from the directory "panels" will be delivered.*/ mapping opt; opt["fromTime"] = t; opt["allIfOneYounger"] = TRUE; dyn_mapping l; l = requestFileList(manID, pattern, opt);/* Function call. Files from the directory "panels" will be delivered. If only one file is younger than 2010.10.04, all files will be delivered. */ DebugN("File list:", l); } |
Assignment
Availability
CTRL |
See also
V 3.11 SP1
Copyright