当我试图打开要写入的文件时,出现ada.io_exceptions.name_错误。
过程调用是
打开
文件名为“c:\ cc_test_log.txt”。此文件不存在。
这是在windows xp的ntfs分区上。用户具有创建和写入目录的权限。
文件名远低于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;