fclose не освобождает файл.

MElin
Дата: 01.03.2007 14:14:24
Доброго времени суток!

Столкнулся со странной проблемой:
oracle 9.1.0.7 Windows 32
открываю файл командой:
hFile := Utl_File.fopen('d:\export\', aExportFile, 'w');
провожу запись в файл.
потом закрываю:
Utl_File.fclose(hFile);
НО! файл продолжает быть открытым!
т.е. в него не удается ничего записать сторонними программами, не удалить.
при повторном вызове Utl_File.fopen('d:\export\', aExportFile, 'w') возвращает ошибку: utl_file.invalid_operation
что делать????
Nike_K
Дата: 01.03.2007 14:48:50
Случайно не перехватывашь исключение при

Utl_File.fclose(hFile);

знаменитым способом

WHEN OTHERS THEN NULL;

Oracle9i Supplied PL/SQL Packages and Types Reference
If there is buffered data yet to be written when FCLOSE runs, then you may receive a WRITE_ERROR exception when closing a file.
MElin
Дата: 01.03.2007 15:16:36
нет.....

  begin
    Utl_File.fclose(hFile); 
  exception 
    when others then
      dbms_output.put_line('Error' );
  end;    

В буфере после выполнения ничего нет.
Nike_K
Дата: 01.03.2007 15:23:39
А

utl_file.is_open(hFile)

что говорит?
Madest
Дата: 01.03.2007 16:43:36
автор
hFile := Utl_File.fopen('d:\export\', aExportFile, 'w');

а если заюзать directory?
tru55
Дата: 01.03.2007 16:50:26
Madest
автор
hFile := Utl_File.fopen('d:\export\', aExportFile, 'w');

а если заюзать directory?


DIRECTORY конечно лучше из общих соображений, но для данной проблемы, думаю, без разницы
MElin
Дата: 02.03.2007 08:16:54
Nike_K
А

utl_file.is_open(hFile)

что говорит?

Ничего не говорит. Файл молча открывается (создается).
MElin
Дата: 02.03.2007 08:24:10
Nike_K
А

utl_file.is_open(hFile)

что говорит?

сорри - с утра невнимательно вопрос прочитал :-)
вот такой код:
  if utl_file.is_open(hFile) then
    dbms_output.put_line('before close file is open');
  else
    dbms_output.put_line('before close file is close');
  end if;
  begin
    Utl_File.fclose(hFile); 
  exception 
    when others then
      dbms_output.put_line('Error' );
  end;
  if utl_file.is_open(hFile) then
    dbms_output.put_line('after close file is open');
  else
    dbms_output.put_line('after close file is close');
  end if;
выдает такой выыод:

before close file is open
after close file is close

то есть, с точки зрения оракла он УЖЕ закрыт....