Check Files Locked
Description
The Check files locked action loops over a list of files to check if they are locked by another process.
The way that it verified is by renaming a file to the same name as before.
On certain operating systems (MS Windows systems in particular) this operation will fail if the file is locked.
Options
| Option | Description |
|---|---|
Action name |
The name of the workflow action. |
Settings: Include subfolders |
Enable this option to also check files in subfolders of specified folders |
Settings: Copy previous results to args? |
Pass the result rows of a previous workflow action execution to the files list of this action. |
Files/Folders |
The files or folders to check. |
Wildcard |
The wildcards are Java Regular expressions. For instance .*\.txt would check any file with a .txt extension. |
Result
What this action passes on to the next action. See Action results for how results travel through a workflow.
| Result | Value |
|---|---|
True |
No file is locked. A file or folder that does not exist is not checked and does not make the action false. With nothing to check, the action is true too. |
False |
A file is locked: it cannot be renamed to its own name. The action stops at the first locked file, and the number of errors is 1. |
Result files |
Passed on unchanged. |
Result rows |
Passed on unchanged. With Copy previous results to args?, the file or folder comes from the first field and the wildcard from the second field of each result row, and the list in the dialog is not used, also when there are no result rows. |
| On Linux and macOS a file is reported as locked when its folder is read-only, because it cannot be renamed. Checking stops at a result row with only one field: that row and the rows after it are not checked, the error is logged, and the action is still true. An invalid regular expression in Wildcard is logged as an error for each file, no file in that folder is checked, and the action is still true. |