...
The following script segment prints the file name and absolute path of each file in the directory:
Panel | |
---|---|
Html bobswift | 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 |
---|
<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 | ||||
---|---|---|---|---|
|
...
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 |
---|
<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.
...
Info | ||
---|---|---|
| ||
z/OS datasets store only createdate and accessdate. There is no time (createtime and accesstime) associated with these dates, nor do z/OS datasets store moddate or modtime. |
...