Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

listDirectory

&pagelevel(3)&pagelevel

You use listDirectory to list the files and directories. The located file or directory names are combined in a list. The list is displayed in the parent context in a context object with the specified listObject-Id. The context object is available there after execution of the listDirectory activity.
If an error occurs during the execution of listDirectory then the object is not available.

A listDirectory as a direct child element of a parallel activity does not return a usable event list (see section “parallel”).

You can use baseDir (see section “baseDir”) to define a base directory from which listDirectory is run.
The base directory itself is not listed in the result.

File or directory names may be a maximum of 512 characters in length. This is checked before the Ftscript is run. The length of the resulting file or directory name (baseDir and dirnames or baseDir + filenames) is limited. The length is the number of characters plus 1 character if baseDir does not end with a "/". The check is performed while the Ftscript is being run.
For further information, see section “Specifying file and directory names”

You can use the wildcard symbol *//* to list a directory tree in full.

Format

 <listDirectory listObject="ID" dirnames >
   comment?
   context?
   partner?
   baseDir?
 </listDirectory>

Attributes

Name

Value

Meaning

ref?

string

Reference to a directory context object.

listObject

string

Name of the list context object which is displayed in the parent context. No context element with this name may exist.

dirnames

See section “Directory name attributes”.
To list a directory tree in full, you can specify the wildcard symbol *//* at the end of the name.

Example

 <?xml version="1.0" encoding="UTF-8"?>
 <ftscript version="1">
   <context>
     <list id="RemoteHostList">
       <partner name="UnixP_1">
         <transferAdmission>
           <ftacAdmission ftacAdmission="FTACADM1"/>
         </transferAdmission>
       </partner>
       <partner name="WindowsP_1">
         <transferAdmission>
           <ftacAdmission ftacAdmission="FTACADM2"/>
         </transferAdmission>
       </partner>
     </list>
   </context>
   <listDirectory listObject="FileList">
     <baseDir name="W:/openFT/ftscript/Test/multi"/>
   </listDirectory>
   <foreach listRef="RemoteHostList" selectType="partner"
            contextObject="RemoteHost" execute="parallel">
     <foreach listRef="FileList" selectType="file"
              contextObject="File" execute="parallel">
       <transferFile>
         <fromLocalFile ref="File">
           <directory name="W:/openFT/ftscript/Test/multi"/>    
         </fromLocalFile>
         <toRemoteFile ref="File">
           <partner ref="RemoteHost"/>
           <directory name="frg_eis_12/local/bin"/>
         </toRemoteFile>
       </transferFile>
     </foreach>
   </foreach>
 </ftscript>

In the example, all the files from the local directory W:/openFT/ftscript/Test/multi/ are written to the context object FileList.
The list only contains the file names, not the baseDir directory.

The files are distributed in parallel to frg_eis_12/local/bin/ on all the computers in the RemoteHostList.

The context object FileList from the listDirectory activity is displayed in the context of the parent element (in the example, ftscript).