cannot close stdio

cvs
Slava Pestov 2004-08-08 04:27:30 +00:00
parent f4c239a992
commit 6431535692
4 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@
+ native:
- number upgrading errors
- do something about "base" variable -- too fragile
ERROR: I/O error: [ "primitive_read_line_fd_8" "Resource temporarily unavailable" ]
- errors: don't show .factor-rc

View File

@ -48,7 +48,7 @@ USE: strings
: init-stdio ( -- )
#! Initialize standard input/output.
stdin stdout <char-stream> "stdio" set ;
stdin stdout <char-stream> <stdio-stream> "stdio" set ;
: init-environment ( -- )
#! Initialize OS-specific constants.

View File

@ -104,7 +104,7 @@ USE: namespaces
[ "socket" get ] bind accept-fd <socket-stream> ;
: init-stdio ( -- )
stdin stdout <fd-stream> "stdio" set ;
stdin stdout <fd-stream> <stdio-stream> "stdio" set ;
: exists? ( file -- ? )
#! This is terrible.

View File

@ -27,10 +27,16 @@
IN: stdio
USE: errors
USE: kernel
USE: namespaces
USE: stack
USE: streams
: <stdio-stream> ( stream -- stream )
#! We disable fclose on stdio so that various tricks like
#! with-stream can work.
clone [ [ ] "fclose" set ] extend ;
: flush ( -- )
"stdio" get fflush ;