Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Macro name changed from html to html-bobswift during server to cloud migration processing.

...


The following script segment prints the file name and absolute path of each file in the directory:

Panel

Html bobswift

<pre>
forfiles nt=C:\Example\*
    echo "Filename: $(_file) Abs. Path: $(_path)"
end
echo "Number of files processed: " $(_filecount)
</pre>


Executing this would build a file list containing the files: file1.txt, file2.txt, and file3.txt. Since there are three files in the list that was built, UDM would iterate through the loop three times:

...


This script segment would result in the following output:

Panel

Html bobswift

<pre>
Filename: file1.txt Abs. Path: C:\Example\file1.txt
Filename: file2.txt Abs. Path: C:\Example\file2.txt
Filename: file3.txt Abs. Path: C:\Example\file3.txt

Number of files processed: 3
</pre>

 

Anchor
_file Variable Attributes
_file Variable Attributes
_file Variable Attributes

...

For efficiency reasons, all of these attributes - other than name and type - are retrieved only as requested. You can request to retrieve the file attributes by adding fileattrib=yes to the end of the forfiles call.

For example:

Panel

Html bobswift

<pre>
forfiles src=*.txt fileattrib=yes
    echo "$(_file) is $(_file.size) bytes in size."
end
</pre>


If the information for an attribute cannot be obtained, its value is set to an empty string.

...