And you're sure its a file read error? I was just looking at ways where an error could error only in PLSQL and there's the familiar "privileges through roles" situation where anonymous blocks work but procedures don't eg
SQL> DECLARE
2 PROCEDURE copy_var_templates
3 IS
4 lkv_template_dir CONSTANT varchar2(20) := 'TEMP';
5 lkv_working_dir CONSTANT varchar2(20) := 'TMP';
6 fn_templates sys.odcivarchar2list := sys.odcivarchar2list('file1.dat','file2.dat','file3.dat','file4.dat');
7 BEGIN
8 FOR i
9 IN (SELECT COLUMN_VALUE template_name
10 FROM TABLE (fn_templates)) --This Pipelined SQL spits the filenames
11 LOOP
12 UTL_FILE.fcopy (
13 lkv_template_dir,
14 i.template_name,
15 lkv_working_dir,
16 replace (i.template_name, 'file', 'newfile'));
17 END LOOP;
18 END;
19 BEGIN
20 copy_var_templates;
21 END;
22 /
PL/SQL procedure successfully completed.
SQL>
SQL> create or replace procedure P is
2 lkv_template_dir CONSTANT varchar2(20) := 'TEMP';
3 lkv_working_dir CONSTANT varchar2(20) := 'TMP';
4 fn_templates sys.odcivarchar2list := sys.odcivarchar2list('file1.dat','file2.dat','file3.dat','file4.dat');
5 BEGIN
6 FOR i
7 IN (SELECT COLUMN_VALUE template_name
8 FROM TABLE (fn_templates)) --This Pipelined SQL spits the filenames
9 LOOP
10 UTL_FILE.fcopy (
11 lkv_template_dir,
12 i.template_name,
13 lkv_working_dir,
14 replace (i.template_name, 'file', 'newfile'));
15 END LOOP;
16 END;
17 /
Procedure created.
SQL> exec p
BEGIN p; END;
*
ERROR at line 1:
ORA-29289: directory access denied
ORA-06512: at "SYS.UTL_FILE", line 270
ORA-06512: at "SYS.UTL_FILE", line 1243
ORA-06512: at "SCOTT.P", line 10
ORA-06512: at "SCOTT.P", line 10
ORA-06512: at line 1
because the directory privileges here were granted via a role.