Hi,
I've got DIRECTORY object (SWDE_DIR) pointing to directory /oradata/mydata. There is also directory /oradata/mydata/dir1 with several files. I am able to run
create or replace function get_filesize(p_file varchar2) return number is
v_exists boolean;
v_length number;
v_blocksize number;
begin
UTL_FILE.fgetattr('SWDE_DIR', p_file, v_exists, v_length, v_blocksize);
if v_exists then
return v_length;
end if;
return -1;
end get_filesize;
When I run
SELECT get_filesize('1.swd') FROM dual;
the result is correct size of the file.
However, when I run
SELECT get_filesize('dir1/sub1.swd') FROM dual;
the result is -1. I'm sure, the file exists there.
What may be wrong?