Category Creo Parametric fundamentals, Object ProFiles

Function ProFilesList


Description
Lists the files in the specified directory. You can pass specific filters to get files with those extensions only.
Replacement in Object TOOLKIT: pfcBaseSession::ListFiles
pfcBaseSession::ListSubdirectories
Synopsis
#include <ProUtil.h>
ProErrorProFilesList(
ProPath directory_path
/* (In)
The directory in which to look for the files to be listed. If this is NULL, the files from the current directory will be listed.
*/
ProLine filter
/* (In)
The user-supplied filter string for file extensions. Each filter must be separated by a comma. For example, "*.prt,*.txt" (converted to a wide-character string). Each individual element in the filter must be less than PRO_NAME_SIZE characters.
*/
ProFileListOpt listing_option
/* (In)
Specifies whether all versions or only the latest versions are being requested, and whether or not the list should be sorted alphabetically. Note: Passing any of _INST options in Wildfire 4.0 M100 and earlier will have the same effect as passing PRO_FILE_LIST_LATEST.
*/
ProPath** p_file_name_array
/* (Out)
The array of files found. You must preallocate this array using ProArrayAlloc(); if you reuse the array, new elements will be appended to the existing elements unless you reset the array size to 0 with ProArraySizeSet.
*/
ProPath** p_subdir_name_array
/* (Out)
The array of all subdirectories found, regardless of whether they match the filter. You must preallocate this array using ProArrayAlloc(); if you reuse the array, new elements will be appended to the existing elements unless you reset the array size to 0 with ProArraySizeSet.
*/
)
Returns
PRO_TK_NO_ERRORThe function successfully returned the files.
PRO_TK_BAD_INPUTSOne or more of the input arguments are invalid.
PRO_TK_INVALID_DIRInvalid directory.
See Also
ProArrayAlloc

Manual References:

  1. Core: Utilities: File Handling
  2. Core: Utilities: File Handling

Sample Code References:

  1. pt_examples ( TestDbms.c )