Read from Disk File Action

image\Actions_Storage_Read_Disk.jpg

The Read from Disk File action is used to retrieve information previously saved into a disk file using the Write to Disk File, or Write Text to File actions. The information retrieved is then stored in a variable for use within your Opus publication.

Note:
This action will open the disk file and copy ALL the contents of the file into the specified variable. There are other actions in the Storage menu that allow you to specify particular positions in the file to read information from: Read First Line from File; Read Next Line from File; Read Next Field from File; Go to Start of File; Go to Next Line in file.

Setting up the Read from Disk File Action:

1. Add the Read from Disk File action to your trigger, as described in adding actions. The Read from Disk File tab will automatically appear when you add the action.

2. Click on the down arrow to the right of the Filename option, to select the name of the disk file from which you want to read the information. Alternatively, use the Browse… button to locate the file on a disk. The full pathname of the file you enter in this box is shown in the Filename field.

Note:
You can enter variables into the Filename field – the variable should contain a valid pathname for the file (see Using variables to create pathnames for more information).

 The file can be on a hard disk, a networked drive or floppy disk. If the network or floppy disk is not available when the publication is run, no warning message will appear and the data is not read.

3. Tick the Get from Windows TEMP directory option if you originally saved the text during the Write action to the windows Temp directory. By default this checkbox is not ticked.

Note:
If you use this option, the Filename field should only contain the name of the text file and not a pathname e.g. results.txt is correct while c:\studentFolder\results.txt would be incorrect.

4. Click on the down arrow to the right of the Variable option, to select the name of the variable in which you want to store the text of the specified disk file.

5. Click on the New… button if have not created the variable yet. This will open the New Variable dialog box. In the dialog box, type a new name for the variable and click the OK button.

6. Click on the Data is encrypted option if this option was used when you created the disk file using the Write actions. Ticking this checkbox will enable the Key field. In the Key field type the name of the key you gave to the disk file in the Write action.

7. Click on the Apply button to save your changes.

Note:
This action will only work for publications that you have published using the Create a Standalone Publication option in the Publish Wizard.

Related Topics:

Introducing the Storage Actions

Restrictions Reading and Writing Disk Files

Using Variables to Create Pathnames

Disk Files vs Windows Registry

the Write to Disk File action