ph_filelist PowerHome formula function
Description
Retrieves a list of files/directories from a specified drive and location.
Syntax
ph_filelist ( filespec, include, exclude, sorted, outputtype )
Argument |
Description |
filespec |
String. The file search specification for the returned filelist. Wildcards are allowed. Ex: "c:\program files\powerhome\*.pbd" |
include |
Long. Only include files with the specified attributes. Use 0 to include all files. Individual attributes should be added together. Typical values are: 1 - ReadOnly, 2 - Hidden, 4 - System, 16 - Directory, 32 - Archive, 2048 - Compressed, 16384 - Encrypted. |
exclude |
Long. Exclude files with these attributes. Use 0 to not exclude files. Individual attributes should be added together. Typical values are: 1 - ReadOnly, 2 - Hidden, 4 - System, 16 - Directory, 32 - Archive, 2048 - Compressed, 16384 - Encrypted. |
sorted |
Integer. Use 0 to return an unsorted list. Any other value to sort. |
outputtype |
Integer. How the output should be returned. Use 0 to return the list as values separted by cr/lf, 1 to return as comma separated values, 2 to return as XML, and 3 to return as an HTML Table. |
Return value
String. Returns the list of files/directories in the format specified by the output type.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_filelist("c:\findMyPhone.txt",0,0,0,0) {Finds specific file}
• ph_filelist("c:\*.txt",0,0,0,0) {Finds all "jpg" files in powerhome directory and lists them unsorted}
• ph_filelist("c:\*.txt",0,5,1,1) {Finds all "jpg" files in powerhome directory that are everything,not Read Only/System, sorts them, and returns them as comma separated values}