Actions
Use the following actions to perform operations on files, directories, and other items in the file system.
- List Directory
-
Opens a new application representing the contents of the directory.
Specify the following parameters:
-
File Access
-
Directory
-
Application Name
Notes on this action:
-
The action can take a significant amount of time to complete.
-
For more information, see Applications and Directories, Directory Tree.
-
- Delete File
-
Deletes a file.
Specify the following parameters:
-
File Access
-
File
-
- Create Directory
-
Creates a directory.
Specify the following parameters:
-
File Access
-
Directory
Notes on the action:
-
The action uses the create directory semantics of the underlying storage.
-
- Delete Directory
-
Deletes a directory.
Specify the following parameters:
-
File Access
-
Directory
Notes on the action:
-
Depending on the underlying storage, the action can fail if the directory is not empty.
-
- Exists
-
Tests if an object exists, and returns the result as true or false.
Specify the following parameters:
-
File Access
-
Item
-
A variable to store the result in the Result field.
-
- Lock Status
-
Performs a test for read/write locks on Windows files, and returns a numerical status indicator.
-
1 File exists and is not locked.
-
0 File exists and is locked (reading and writing).
-
-1 File does not exist.
-
-2 Feature is not supported.
-
-3 Failed for another reason. (Use Get Last Error step to retrieve the underlying error.)
Notes on this action:
-
Lock Status is not available on RFS and Linux.
-
- Copy File
-
Copies a file to a new location. Also use to copy files between RFS and the local file system.
Specify the following parameters using paths with file names:
-
File Access
-
Source
-
Destination
Notes on this action:
-
This action uses the copy semantics of the underlying storage.
-
If you copy the file c:\a\b\c.txt into the directory d:\destination, the Source field must contain c:\a\b\c.txt and the Destination field must contain d:\destination\c.txt. If you omit the file name in the Destination field or the destination directory does not exist, the results may be unpredictable.
-
- Move
-
Moves or renames an object.
Specify the following parameters using paths with object names:
-
File Access
-
Source
-
Destination
Notes on this action:
-
The action cannot be used to move objects between RFS and the local file system.
-
The action uses the move semantics of the underlying storage.
-
- Rename
-
Renames an object in its current location.
Specify the following parameters:
-
File Access
-
Item
-
New Name
-
- Get Type
-
Retrieves the type of an object.
-
file Object is a file.
-
directory Object is a directory.
-
other Object exists, yet is not a file or directory. The exact type of object depends on the underlying storage but it can be other objects, such as devices or symbolic links.
Specify the following parameters:
-
File Access
-
Item
-
A variable to store the result in the Type field.
Notes on this action:
-
A DeviceIssue exception is generated if the object does not exist.
-
- Get Path
-
Retrieves the path to the item.
- Close All Directories
-
Closes all applications associated with directories opened by the robot.
- Close Directory
-
Closes the application.
- Count
-
Counts the number of objects matching the component finder.
Notes on this action:
-
The action performs existence checks and wildcard searches.
-
- Get Last Error
-
Retrieves an error message from the last action performed by the file system driver.
Specify the following parameters:
-
A variable to store the result in the Error field.
-
- Refresh
-
Scans and reloads the directory contents represented by the application, then updates the tree.
Notes on this action:
-
The action can take a significant amount of time to complete.
-
- Zip
-
Creates a ZIP archive or adds files to an existing archive.
Specify the following parameters:
-
Source: a file, a directory or a file-name pattern. If a directory is specified, the directory itself and all its contents are added to the ZIP archive.
See the note below for pattern matching explanation.
-
Destination
-
Access type for both Source and Destination
-
If Destination Exists: select the behavior when the ZIP archive already exists:
-
Overwrite - a new archive is created.
-
Append - a new archive is only created if it does not exist.
-
Fail - the operation fails with an error message.
-
-
Error If Nothing Added: when using a file-name pattern, select this checkbox to raise an error if no files match.
If the source does not contain a wildcard, the operation always raises an error if the specified file or directory cannot be found.
Notes on this action:
-
A ZIP archive can contain multiple entries with the same name and path. Adding files does not overwrite entries, new entries are appended.
-
If Destination is Direct Access with Overwrite and the operation fails, partially created archives are removed. With RFS, the original archive remains unchanged.
-
- Unzip
-
Extracts files from a ZIP archive.
Specify the following parameters:
-
Source
-
Destination
-
Access type for both Source and Destination
-
Extract Matching Pattern: select to specify a file name, a directory or a file-name pattern to extract. Leave blank to extract the entire archive.
If the field does not contain a wildcard, the operation always raises an error if the specified file or directory cannot be found in the archive.
-
Error If Nothing Added: when using a file-name pattern in the Extract Matching Pattern field, select this checkbox to raise an error if no files match.
Notes on this action:
-
When extracting from an archive with multiple entries of the same name, only one random entry is extracted.
The following applies to both Zip and Unzip:
-
Pattern matching supports the "*" wildcard. It matches zero or more characters and can be used only in file names, not directory names. Examples: "*.txt", "*a*z*", "/dir1/dir2/*".
-
Symbolic links and case rules follow the operating system: on Linux links are followed and matching is case-sensitive, on Windows matching is case-insensitive.
-