1.9.1 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 1.9.1(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\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\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 |
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 |
|
Shortcuts |
MakeGroup |
|
DeleteGroup |
||
DeleteShortcut |
||
Process monitoring |
GetProcessCount |
|
TerminateProcess |
||
Statement |
For...End For |