"File-access + extensions"

file [ANS]
* BIN ( access-mode -- access-mode' )

modify the give file access-mode to be a binary-mode

FORTH/ANS file (dpANS11.6.1.0765) ordinary primitive

* CLOSE-FILE ( file -- code )

close the file and return the status-code

FORTH/ANS file (dpANS11.6.1.0900) ordinary primitive

* 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.

FORTH/ANS file (dpANS11.6.1.1010) ordinary primitive

* DELETE-FILE ( str-adr str-len -- code )

delete the named file and return a status code

FORTH/ANS file (dpANS11.6.1.1190) ordinary primitive

* FILE-POSITION ( file -- p.pos code )

return the current position in the file and
return a status code. A code of zero means success.

FORTH/ANS file (dpANS11.6.1.1520) ordinary primitive

* FILE-SIZE ( file -- s.size code )

return the current size of the file and
return a status code. A code of zero means success.

FORTH/ANS file (dpANS11.6.1.1522) ordinary primitive

* INCLUDE-FILE ( file -- )

INTERPRET the given file

FORTH/ANS file (dpANS11.6.1.1717) ordinary primitive

* INCLUDED ( str-adr str-len -- )

open the named file and then INCLUDE-FILE
see also the interactive INCLUDE

FORTH/ANS file (dpANS11.6.1.1718) ordinary primitive

* 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.

FORTH/ANS file (dpANS11.6.1.1970) ordinary primitive

R/O

[] no special info, see general notes

FORTH/ANS file (dpANS11.6.1.2054) ordinary constant

R/W

[] no special info, see general notes

FORTH/ANS file (dpANS11.6.1.2056) ordinary constant

* 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.

FORTH/ANS file (dpANS11.6.1.2080) ordinary primitive

* 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

FORTH/ANS file (dpANS11.6.1.2090) ordinary primitive

* REPOSITION-FILE ( o.offset file -- code )

reposition the file offset - the next FILE-POSITION
would return o.offset then. returns a status code.

FORTH/ANS file (dpANS11.6.1.2142) ordinary primitive

* RESIZE-FILE ( s.size file -- code )

resize the give file, returns a status code.

FORTH/ANS file (dpANS11.6.1.2147) ordinary primitive

W/O

[] no special info, see general notes

FORTH/ANS file (dpANS11.6.1.2425) ordinary constant

* WRITE-FILE ( str-adr str-len file -- code )

write characters from the string buffer to a file,
returns a status code.

FORTH/ANS file (dpANS11.6.1.2480) ordinary primitive

* 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.

FORTH/ANS file (dpANS11.6.1.2485) ordinary primitive

* 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.

FORTH/ANS file (dpANS11.6.2.1524) ordinary primitive

* FLUSH-FILE ( file -- code )

flush all unsaved buffers of the file to disk.
A status code of zero means success.

FORTH/ANS file (dpANS11.6.2.1560) ordinary primitive

* 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

FORTH/ANS file (dpANS11.6.2.2130) ordinary primitive

ENVIRONMENT ENVIRONMENT FILE-EXT

[] no special info, see general notes

ENVIRONMENT file ordinary constant

ENVIRONMENT MAX-FILES

[] no special info, see general notes

ENVIRONMENT file ordinary primitive