Go to the first, previous, next, last section, table of contents.


Files

This chapter describes how to operate on files from Forth.

Files have the following types for opening and creating:

r/o       -- fam         file       ``r-o''

r/w       -- fam         file       ``r-w''

w/o       -- fam         file       ``w-o''

bin       fam1 -- fam2         file       ``bin''

Files are opened/created by name and type, and return a file identifier.

open-file       c-addr u ntype -- w2 wior       file       ``open-file''

create-file       c-addr u ntype -- w2 wior       file       ``create-file''

This identifier is used for all other file commands.

close-file       wfileid -- wior       file       ``close-file''

delete-file       c-addr u -- wior       file       ``delete-file''

rename-file       c-addr1 u1 c-addr2 u2 -- wior       file-ext       ``rename-file''

rename file c_addr1 u1 to new name c_addr2 u2

read-file       c-addr u1 wfileid -- u2 wior       file       ``read-file''

read-line       c-addr u1 wfileid -- u2 flag wior       file       ``read-line''

write-file       c-addr u1 wfileid -- wior       file       ``write-file''

emit-file       c wfileid -- wior       gforth       ``emit-file''

flush-file       wfileid -- wior       file-ext       ``flush-file''

file-status       c-addr u -- ntype wior       file-ext       ``file-status''

file-position       wfileid -- ud wior       file       ``file-position''

reposition-file       ud wfileid -- wior       file       ``reposition-file''

file-size       wfileid -- ud wior       file       ``file-size''

resize-file       ud wfileid -- wior       file       ``resize-file''


Go to the first, previous, next, last section, table of contents.