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 syntax of the forfiles statement is:

Panel

Html bobswift
<pre>
forfiles logical_name=file_spec
         [sortby=attribute-name[,ascending | descending]]
         [msecs=yes | no]
  ...
  UDM commands
  ...
end
</pre>

logical_name is the logical name of a transfer server.

...

To obtain a file list, sorted by creation date (earliest to latest):

Panel

Html bobswift

<pre>
forfiles src=*.txt sortby=createdate
    # Do some stuff
end
</pre>

 

Top obtain a file list, ordered by file size from largest to smallest:

Panel

Html bobswift

<pre>
forfiles src=*.exe sortby=size,descending
    # Do some more stuff
end
</pre>

 

An error would be produced if sortby was present without a value or if it referred to an attribute that does not exist for the _file variable.
 

To display modification times and timestamps for a list of files in the current directory with an extension of *.txt:

Panel

Html bobswift
<pre>
forfiles src=*.txt fileattrib=yes msecs=yes
   echo $(_file) ": " $(_file.modtime) ", " $(_file.modtimestamp)
end
</pre>

Detailed Information

The following pages provide detailed information for the Universal Data Mover forfiles statement:

...