Puede usar el UTL_FILE
paquete. Por ejemplo, esto verificará que puede crear un nuevo archivo llamado some_new_file_name.txt
en el directorio y escribir datos en él
DECLARE
l_file utl_file.file_type;
BEGIN
l_file := utl_file.fopen( 'EXT_DATA_FILES', 'some_new_file_name.txt', 'W' );
utl_file.put_line( l_file, 'Here is some text' );
utl_file.fclose( l_file );
END;
Esto verificará que un archivo llamado existing_file_name.txt
existe y es legible
DECLARE
l_exists boolean;
l_size integer;
l_block_size integer;
BEGIN
utl_file.fgetattr( 'EXT_DATA_FILES',
'existing_file_name.txt',
l_exists,
l_size,
l_block_size );
if( l_exists )
then
dbms_output.put_line( 'The file exists and has a size of ' || l_size );
else
dbms_output.put_line( 'The file does not exist or is not visible to Oracle' );
end if;
END;