Commit 2353aeeb by Pascal Obry Committed by Arnaud Charlet

s-fileio.adb (Is_Open): Add check for usability of the underlying file stream.

2007-08-14  Pascal Obry  <obry@adacore.com>

	* s-fileio.adb (Is_Open): Add check for usability of the underlying
	file stream.

From-SVN: r127461
parent b1b1010f
......@@ -610,7 +610,13 @@ package body System.File_IO is
function Is_Open (File : AFCB_Ptr) return Boolean is
begin
return (File /= null);
-- We return True if the file is open, and the underlying file stream is
-- usable. In particular on Windows an application linked with -mwindows
-- option set does not have a console attached. In this case standard
-- files (Current_Output, Current_Error, Current_Input) are not created.
-- We want Is_Open (Current_Output) to return False in this case.
return File /= null and then fileno (File.Stream) /= -1;
end Is_Open;
-------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment