Re: UTL_FILE : invalid_path error

From: Rick Wessman <Rick.Wessman_at_oracle.com>
Date: 12 Mar 2002 09:39:37 -0800
Message-ID: <socelipptwm.fsf_at_rwessman-sun.us.oracle.com>


I don't know why fopen() is failing, but it is a bad idea to set utl_file_dir to *. This setting allows any user to overwrite any file including database files and Oracle executables. I strongly suggest that the value be set to '/u12'.

                                    Rick

adityanath_at_hotmail.com (Aditya) writes:

> Hi!
>
> I am trying to use utl_file package.
> My Oracle is on SunOS
>
> I have put in the following line in init.ora
>
> utl_file_dir = *
>
> I have restarted the Oracle server
>
> And my code is
>
> Create Or Replace Procedure sp_report_data
> IS
> ls_string varchar2(1000);
> file_id UTL_FILE.FILE_TYPE;
> Begin
> dbms_output.put_line ('before open');
> file_id := UTL_FILE.FOPEN ('/u12/dashboard', 'Error.txt', 'W');
> dbms_output.put_line ('after open');
> ls_string := 'data uploaded successfully';
> UTL_FILE.PUT (file_id,ls_string);
> UTL_FILE.FCLOSE (file_id);
>
> EXCEPTION
> WHEN UTL_FILE.INVALID_PATH THEN
> dbms_output.put_line('path not valid');
> WHEN UTL_FILE.INVALID_MODE THEN
> dbms_output.put_line('file mode not valid');
> WHEN UTL_FILE.INVALID_OPERATION THEN
> dbms_output.put_line('file operation not valid');
> End;
>
> It is going into the exception UTL_FILE.INVALID_PATH
> just after UTF_FILE.FOPEN statement.
>
> Any suggestion is highly appretiated.
>
> Regards,
> Aditya
> adityanath_at_hotmail.com

-- 
                                Rick Wessman
                                Security Assurance Group
                                Oracle Corporation
                                Rick.Wessman_at_oracle.com

     The opinions expressed above are mine and do not necessarily reflect
                         those of Oracle Corporation.
Received on Tue Mar 12 2002 - 18:39:37 CET

Original text of this message