[英]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.