当我尝试打开要写入的文件时,出现错误:Ada.IO_Exceptions.Name_Error
. 过程调用是Ada.Text_IO.Open
;文件名为C:\CC_TEST_LOG.TXT
. 该文件不存在。
这是在 NTFS 分区上的 Windows XP 上。用户有权创建和写入目录。文件名远低于 WIN32 最大路径长度。
name_2 : String := "C:\CC_TEST_LOG.TXT"
if name_2'last > name_2'first then
begin
Ada.Text_IO.Open(file, Ada.Text_IO.Out_File, name_2);
Ada.Text_IO.Put_Line(
"CC_Test_Utils: LogFile: ERROR: Open, File "
& name_2);
return;
exception
when The_Error : others =>
Ada.Text_IO.Put_Line(
"CC_Test_Utils: LogFile: ERROR: Open Failed; "
& Ada.Exceptions.Exception_Name(The_Error)
& ", File " & name_2);
end;
end if;