FILE --- Optional File-Access Word Set
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: The Optional File-Access Word Set and File-Access Extension Words. These words imply some kind of file-system unlike the BLOCK wordset.
FORTH
BIN
( access-mode -- access-mode' )( | ) ; |
; |
modify the give file access-mode to be a binary-mode
dpANS 11.6.1.0765 - standard forth word
FORTH
CLOSE-FILE
( file -- code )( | ) ; |
; |
close the file and return the status-code
dpANS 11.6.1.0900 - standard forth word
FORTH
CREATE-FILE
( str-adr str-len mode -- file code )( | ) ; |
; |
create the file with the given name and open it - returns the file id and a status code. A code of zero means success. An existing file of the same name is truncated upon open.
dpANS 11.6.1.1010 - standard forth word
FORTH
DELETE-FILE
( str-adr str-len -- code )( | ) ; |
; |
delete the named file and return a status code
dpANS 11.6.1.1190 - standard forth word
FORTH
FILE-POSITION
( file -- p.pos code )( | ) ; |
; |
return the current position in the file and return a status code. A code of zero means success.
dpANS 11.6.1.1520 - standard forth word
FORTH
FILE-SIZE
( file -- s.size code )( | ) ; |
; |
return the current size of the file and return a status code. A code of zero means success.
dpANS 11.6.1.1522 - standard forth word
FORTH
INCLUDE-FILE
( file -- )( | ) ; |
; |
INTERPRET the given file
dpANS 11.6.1.1717 - standard forth word
FORTH
INCLUDED
( str-adr str-len -- )( | ) ; |
; |
open the named file and then INCLUDE-FILE see also the interactive INCLUDE
dpANS 11.6.1.1718 - standard forth word
FORTH
OPEN-FILE
( str-adr str-len mode -- file code )( | ) ; |
; |
open the named file with mode. returns the file id and a status code. A code of zero means success.
dpANS 11.6.1.1970 - standard forth word
FORTH
R/O
( .. )(
)
;
as:"r-slash-o";
( FMODE_RO ) constant R/O
an ordinary constant (no special usage info)
dpANS 11.6.1.2054 - standard forth word
FORTH
R/W
( .. )(
)
;
as:"r-slash-w";
( FMODE_RW ) constant R/W
an ordinary constant (no special usage info)
dpANS 11.6.1.2056 - standard forth word
FORTH
READ-FILE
( str-adr str-len file -- count code )( | ) ; |
; |
fill the given string buffer with characters from the buffer. A status code of zero means success and the returned count gives the number of bytes actually read. If an error occurs the number of already transferred bytes is returned.
dpANS 11.6.1.2080 - standard forth word
FORTH
READ-LINE
( str-adr str-len file -- count flag code )( | ) ; |
; |
fill the given string buffer with one line from the file. A line termination character (or character sequence under WIN/DOS) may also be placed in the buffer but is not included in the final count. In other respects this function performs a READ-FILE
dpANS 11.6.1.2090 - standard forth word
FORTH
REPOSITION-FILE
( o.offset file -- code )( | ) ; |
; |
reposition the file offset - the next FILE-POSITION would return o.offset then. returns a status code.
dpANS 11.6.1.2142 - standard forth word
FORTH
RESIZE-FILE
( s.size file -- code )( | ) ; |
; |
resize the give file, returns a status code.
dpANS 11.6.1.2147 - standard forth word
FORTH
W/O
( .. )(
)
;
as:"w-slash-o";
( FMODE_WO ) constant W/O
an ordinary constant (no special usage info)
dpANS 11.6.1.2425 - standard forth word
FORTH
WRITE-FILE
( str-adr str-len file -- code )( | ) ; |
; |
write characters from the string buffer to a file, returns a status code.
dpANS 11.6.1.2480 - standard forth word
FORTH
WRITE-LINE
( str-adr str-len file -- code )( | ) ; |
; |
write characters from the string buffer to a file, and add the line-terminator to the end of it. returns a status code.
dpANS 11.6.1.2485 - standard forth word
FORTH
FILE-STATUS
( str-adr str-len -- sub-code code )( | ) ; |
; |
check the named file - if it exists the status code is zero. The sub-code is implementation-specific.
dpANS 11.6.2.1524 - standard forth word
FORTH
FLUSH-FILE
( file -- code )( | ) ; |
; |
flush all unsaved buffers of the file to disk. A status code of zero means success.
dpANS 11.6.2.1560 - standard forth word
FORTH
RENAME-FILE
( str-adr1 str-len1 str-adr2 str-len2 -- code )( | ) ; |
; |
rename the file named by string1 to the name of string2. returns a status-code
dpANS 11.6.2.2130 - standard forth word
ENVIRONMENT
FILE-EXT
( .. )(
)
;
as:"file-minus-ext";
( 1994 ) constant FILE-EXT
an ordinary constant (no special usage info)
ENVIRONMENT
MAX-FILES
( .. )(
)
;
as:"max-minus-files";
ordinary primitive MAX-FILES
an executable word (no special usage info)
or wrapper call around p__max_files