[英]Why are my attempts to open a file using open for writing failing?
当我尝试打开要写入的文件时,出现错误: 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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.