The readfile() function returns the contents of a file in a character string. Any file type can be processed. The entire file is placed in a single character string. The length() function can be used to determine the length of the returned character string.

Additionally, readfile checks whether the file passed as argument is in the configuration database (/etc/pb.db), and if it is, reads the file from the database. If the file is not in the database, readfile reverts to check if the file is in the filesystem.

readfile (filename);

filename Required. Character string that contains the complete path and file name of the file to read.

Character string that contains the contents of the specified file.

result = readfile ("/var/adm/pblog.txt");

If the /path/file is imported to the config database, then readfile gets the file from the config database:

# pbadmin –cfg -i /path/file

For more information, please see the following: