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: + native:
- number upgrading errors
- do something about "base" variable -- too fragile - do something about "base" variable -- too fragile
ERROR: I/O error: [ "primitive_read_line_fd_8" "Resource temporarily unavailable" ] ERROR: I/O error: [ "primitive_read_line_fd_8" "Resource temporarily unavailable" ]
- errors: don't show .factor-rc - errors: don't show .factor-rc

View File

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

View File

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

View File

@ -27,10 +27,16 @@
IN: stdio IN: stdio
USE: errors USE: errors
USE: kernel
USE: namespaces USE: namespaces
USE: stack USE: stack
USE: streams 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 ( -- ) : flush ( -- )
"stdio" get fflush ; "stdio" get fflush ;