2.4.5 Setting lock error retry function
If you access a file or folder immediately after its update, a temporary lock error might occur due to a disk write delay. When the lock error retry function is enabled, if a lock error occurs in a file or folder, a command retries file access. As a result, you no longer need to specify the retry processing in a script.
The lock error retry function retries access to a file or folder according to the specified retry count and retry wait time until the lock is cleared or another error occurs. The following describes the operation of the lock error retry function:
- If the lock was cleared during retry and the file or folder was accessed normally:
-
The retry is terminated and processing of the command or statement continues.
- If an error other than a lock error occurred during retry:
-
The retry is terminated, and execution of the command or statement is terminated due to the error.
- If the lock was not cleared by the retry:
-
Execution of the command or statement is terminated due to the lock error.
Use the SetRetryMode command to retry only when a specific command is called. Even if the lock retry function is disabled, the SetRetryMode command allows the error retry function to take effect only when a specific command is called. You can also set the retry count and retry wait time for each command. For details about the commands that can be used with the lock error retry function, see 2.4.5(2) Commands and statements that can be used with the lock error retry function. For details about the SetRetryMode command, see 9.9.2 SetRetryMode (set the lock error retry function).
- Organization of this subsection
(1) Retry count and retry wait time
The retry count and retry wait time are set as registry values.
(a) Retry count (units: number of times)
- Registry key
-
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Hitachi\JP1/Script\SPTX
- Value name
-
IOErrorRetryCount
- Value datatype
-
REG_DWORD
- Value
-
-
Specify a value in the range from 0 to 100. The default is 0.
-
If 0 is specified, no retry is performed.
-
If no value is set or if a value outside the range from 0 to 100 is specified, a default of 0 is assumed.
-
- When the setting takes effect
-
The setting takes effect the next time the script file is executed.
(b) Retry wait time (units: seconds)
- Registry key
-
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Hitachi\JP1/Script\SPTX
- Value name
-
IOErrorRetryWaitTime
- Value datatype
-
REG_DWORD
- Value
-
-
Specify a value in the range from 1 to 60. The default is 1.
-
If no value is set or if a value outside the range from 1 to 60 is specified, a default of 1 is assumed.
-
- When the setting takes effect
-
The setting takes effect the next time the script file is executed.
(c) Extent of the settings
The settings are effective on all scripts that are executed after the values are set in the registry. The values set in the registry are effective only on the computer on which they are set.
(d) Changing the retry count and retry wait time
Use the SetRetryMode command to change the retry count and retry wait time set in the registry. The changes are effective until the ResetRetryMode command is executed.
(2) Commands and statements that can be used with the lock error retry function
The following table lists the commands and statements that can be used with the lock error retry function.
Type |
Category |
Command or statement |
---|---|---|
Basic command |
Variable manipulation |
SetEnvironment or SetEnv |
GetEnvironment or GetEnv |
||
SetGV |
||
GetGV |
||
DeleteGV |
||
File and folder management |
IniRead |
|
IniWrite |
||
TextFileReplace |
||
TextOpen |
||
MakeDir |
||
DeleteDir |
||
DeleteFile |
||
Rename |
||
TempDir |
||
TempFile |
||
SetFileAttribute or SetFileAttr |
||
GetFileAttribute or GetFileAttr |
||
SetFileTime |
||
GetFileTime |
||
GetFileSize |
||
GetVersionInfo or GetVerInfo |
||
SplitFile |
||
CatFiles |
||
SetStandardFile or SetStdFile |
||
SetPath |
||
Copy |
||
Message output |
Message |
|
Menu display |
Menu |
|
Evaluations |
IsEmptyDir |
|
IsExistDir |
||
IsExistFile |
||
IsWriteableDir |
||
IsFileAttribute or IsFileAttr |
||
IsNew |
||
External program calls |
Exec |
|
NetExec |
||
CallSpt |
||
Automatic startup |
EntryStartUp |
|
CancelStartUp |
||
Special command |
Registry operations |
RegRead |
RegWrite |
||
RegDelete |
||
RegDeleteKey |
||
Graphics display |
BitmapShow |
|
Evaluations |
IsEmptyGroup |
|
Shortcuts |
MakeGroup |
|
DeleteGroup |
||
MakeShortcut |
||
DeleteShortcut |
||
Process monitoring |
GetProcessCount |
|
TerminateProcess |
||
Statement |
For...End For |
- Important
-
-
This function is used to prevent the occurrence of lock errors caused by disk write delays in the Windows file system. During normal operations, if you execute a script that accesses the following types of files or folders, execution performance might be degraded because of the delayed detection of lock errors.
- Files or folders that are being accessed by another process for an extended period of time
- Files or folders for which the user lacks access privileges
-
If you execute a script for which multi-activation is allowed, lock errors might occur more frequently because the script might attempt multiple simultaneous accesses to the same file or folder. To use this function to prevent the occurrence of lock errors, set the lock error retry function so that the maximum retry duration (that is calculated by multiplying the retry count and the retry wait time) is 60 seconds or longer. For example, to set a maximum retry duration of 60 seconds, set the retry count to 60 and the retry wait time to 1.
-