Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Open a File from Oracle but only if it is close
shirley_sanjuan_at_tutopia.com (Shirley) wrote in message news:<6aa4dd9a.0412021148.190f9ec5_at_posting.google.com>...
> Hi,
>
> I am doing a program in Delphi that writes a file, and the file is
> read from Oracle using UTL_FILE. But I need Oracle reads the file only
> if the another program finish to write the file.
>
> ¿Somebody knows how I validate that?
If a process opens a file and does not allow FILE_SHARE_READ/WRITE/DELETE access then no other process can open that file until the file handle is closed by the original process. Utl_File.fopen will quietly throw "invalid_operation" exception in this case so need for extra checks.
In C++, CreateFile allows this option as dwShareMode parameter, I will be surprised if Delphi does not. I think you should code it as such on Delphi side rather then making other process guess if the file is available to read or not.
Regards
/Rauf
Received on Thu Dec 02 2004 - 18:07:49 CST
![]() |
![]() |