One can read/write operating system text files by using the UTL_FILE package. It provides a restricted version of the operating system stream file I/O, and it is available for both client-side and server-side PL/SQL.
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/home/oracle/tmp','myoutput','z');
UTL_FILE.PUTF(file, 'Value of func1 is %sn',func1(2));
UTL_FILE.FCLOSE(file;
END;