Working with List Files & Directories Process

Navigation:  How to Work with Processes > Working with the Data File Processes Group >

Working with List Files & Directories Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "List Files & Directories" process is used to create a list of the files and/or directories contained in a specific device folder. This list can be stored in a file or variable.

 

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "List Files & Directories" process. In this case, the properties window includes two tabs - "General" and "Advanced".

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

"General" Tab

 

 

Fill in the following options:

 

Search For

Files

Define the entity/entities to be listed by checking the corresponding box - Files and/or Directories (folders included in the destination folder).

Directories

Mask

Define the pattern that will be used to return the files/directories for your list OR  click to select the variable with the intended value.

 

You can use "*" as a file pattern (ex: "*.ini" will return all ".ini" files from the specified folder).

 

Search In

Folder

Define the location of the files/directories to search for so the list can be created. Select one of the locations available in the drop-down ("<DATA>"; "<RES>"; "<SHARED>"; "<EXTDATA>"; or "<EXTSHARED>") OR  click to select the variable with the intended value.

 

"<DATA>"; "<RES>"; "<SHARED>" are aliases for MCL folders within the device. See Working with Aliases for more details.

"<EXTDATA>"; or "<EXTSHARED>" are aliases that refer to locations outside the MCL environment.

Include Subdirectories

If required, check this option so the search for the intended files includes the existing subdirectories.

Results

Destination

Define the type of element that will store the resulting list - check "Variable" or "File".

The following option relates to the destination type you selected previously:

 

Destination

Related Field

Variable

"Variable" field - Click to define the variable that will receive the file/directory list information.

File

"File Name" field - Enter the name of the file that will store the list OR  click to edit the selected data file (see Editing a Data File).

 

If required, use (window's upper right corner) to create a new data file. See Creating a Data File.

 

The "Advanced" tab allows you to define what file information should be attached to each listed file. If the data file you select here does not have enough fields to store that data, the system will add fields to the file as needed.

 

If you use the same data file to store the files list in every "List Files & Directories" occurrence, the data file's content will be replaced with every process execution.

 

Number of Files

Click to define the variable that will receive the "Number of files" information.

Total Size (Bytes)

Click to define the variable that will receive the "Total Size (Bytes)" information.

 

Proceed to the "Advanced" tab.

 

"Advanced" Tab

 

 

Fill in the following options:

 

Results Data & Format

Include

Check the information/characteristics you want to view regarding each listed file.

 

If "Date/Time" is checked, select the intended output format from the drop-down.

Order By

Define which of the attributes available in the drop-down will be used to base the sorting of the list on ("File Name"; "File Extension"; "File Date/Time" or "File Size").

 

Define the sorting order of the file list by checking "Ascending" OR  "Descending".

Field Separator

Select the field separator to be used to separate the previously defined information/characteristics.

Record Separator

Select the record separator from the drop-down.

Output Example

This section provides an output preview that is the result of your data and format choices in this tab.

Filter

File Size

Define the minimum and maximum sizes (in KB) for the files to be listed.

Ex: If you define 12 KB as a minimum value and 35 KB as maximum value, the list will include all the files in the intended folder that have a size of, at least, 12 KB up to  35 KB.

 

If the "Min" and "Max" options are left blank, all the files in the selected target folder will be listed regardless of their size.

If necessary, you can use up to 3 decimal places to define a minimum/maximum value. Ex: Defining a max value of "0.800 KB" means that the list can only include files with a maximum size of 102.400 Bytes.

Max. Files to Return

Define the maximum number of files to be listed.

 

If the option is left blank, all the files of the target folder that meet the defined filter criteria will be listed.

 

If required, use the icons on the upper right corner of the process properties window:

 

Click this icon to create a new data file. Go to Creating a Data File to see how to fill in the several options available.

 

Use the icon to attach any relevant notes to this process. Click it and enter your notes in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".

 

 

Click to conclude and apply the choices made in both tabs or select to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.