io.files vocabulary - Factor Documentation (original) (raw)

Documentation
Reading and writing files

Metadata

Parents: io
Authors: Slava Pestov, Daniel Ehrenberg

Words

Tuple classes

Class Superclass Slots
no-such-file tuple path

Mixin classes

file-reader
file-writer

Generic words

Word Stack effect
(file-appender) ( path -- stream )
(file-reader) ( path -- stream )
(file-writer) ( path -- stream )
(file-writer-secure) ( path -- stream )
drain ( port handle -- event/f )
refill ( port handle -- event/f )
wait-for-fd ( handle event -- )

Symbol words

+input+
+output+
+retry+

Ordinary words

Word Stack effect
( path encoding -- stream )
( path encoding -- stream )
( path encoding -- stream )
( path encoding -- stream )
change-file-contents ( ..a path encoding quot: ( ..a seq -- ..b seq' ) -- ..b )
change-file-lines ( ..a path encoding quot: ( ..a seq -- ..b seq' ) -- ..b )
check-file-exists ( path -- path )
file-contents ( path encoding -- seq )
file-exists? ( path -- ? )
file-lines ( path encoding -- seq )
if-file-exists ( ..a path true: ( ..a path -- ..b ) false: ( ..a path -- ..b ) -- ..b )
init-resource-path ( -- )
no-such-file ( path -- * )
set-file-contents ( seq path encoding -- )
set-file-lines ( seq path encoding -- )
unless-file-exists ( ... path quot: ( ... path -- ... ) -- ... )
when-file-exists ( ... path quot: ( ... path -- ... ) -- ... )
with-file-appender ( path encoding quot -- )
with-file-reader ( path encoding quot -- )
with-file-writer ( path encoding quot -- )
with-file-writer-secure ( path encoding quot -- )

Class predicate words

Word Stack effect
file-reader? ( object -- ? )
file-writer? ( object -- ? )
no-such-file? ( object -- ? )

Files

resource:core/io/files/files.factor
resource:core/io/files/files-docs.factor
resource:core/io/files/files-tests.factor

Metadata files

resource:core/io/files/authors.txt
resource:core/io/files/summary.txt

Children from resource:basis

Vocabulary Summary
io.files.info File and file system metadata
io.files.links Working with symbolic links
io.files.temp
io.files.types File types for file-info and directory listing
io.files.unique Temporary files with unique names
io.files.unix Implementation of reading and writing files on Unix-like systems
io.files.windows

Children from resource:extra

Vocabulary Summary
io.files.acls
io.files.trash Send files to the trash bin.