1.9.2 Trial-open function
If enabled, the trial-open function tries to open a closed file according to the specified trial-open retry count and trial-open retry interval. This is in order to confirm that the data has been written to the disk. The function tries to open the file immediately after the TextClose command is executed. The function does not perform anything in the following cases:
-
A file that was opened by using the TextOpen command with ReadOnly specified for the Mode parameter is closed by using the TextClose command.
-
An attempt to close the file failed, causing the TextClose command to end with error.
If a lock error occurred during an attempt to open the file, the function retries opening the file until the lock is cleared or another error occurs.
The following describes the operation of the trial-open function:
- If the lock was cleared during an attempt to open the file:
-
The trial-open is terminated and the TextClose command terminates normally.
- If an error other than a lock error occurred during an attempt to open the file:
-
The trial-open is terminated and the TextClose command terminates normally.
- If the lock was not cleared after the attempts to open the file:
-
The TextClose command terminates normally.
If you want to trial-open the file only after a specific TextClose command was executed, use the SetTrialOpenMode command according to 9.9.4 SetTrialOpenMode (set the trial-open function). Even if the trial-open function is disabled, the SetTrialOpenMode command allows the trial-open function to take effect only after a specific TextClose command is executed. You can also set the trial-open retry count and trial-open retry interval for each execution of the SetTrialOpenMode command.
- Organization of this subsection
(1) Trial-open retry count and trial-open retry interval
Set the trial-open retry count and the trial-open retry interval in the registry.
(a) Trial-open retry count (units: number of times)
- Registry key
-
HKEY_LOCAL_MACHINE\SOFTWARE\Hitachi\JP1/Script\SPTX
- Value name
-
TrialOpenRetryCount
- Value datatype
-
REG_DWORD
- Value
-
-
Specify a value in the range from 0 to 100. The default is 0.
-
If 0 is set, an attempt to open the file will not be made.
-
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) Trial-open retry interval (units: milliseconds)
- Registry key
-
HKEY_LOCAL_MACHINE\SOFTWARE\Hitachi\JP1/Script\SPTX
- Value name
-
TrialOpenRetryWaitTime
- Value datatype
-
REG_DWORD
- Value
-
-
Specify a value in the range from 100 to 60,000. The default is 100.
-
If no value is set or if a value outside the range from 100 to 60,000 is specified, a default of 100 is assumed.
-
- When the setting takes effect
-
The setting takes effect the next time the script file is executed.
(c) Scope 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 trial-open retry count and trial-open retry interval
Use the SetTrialOpenMode command to change the trial-open retry count and trial-open retry interval set in the registry. The changes are effective until the ResetTrialOpenMode command is executed.