Reading files in factor

April 10, 2009 at 7:08 pm Leave a comment

Working code for the impatient

The following factor code reads and counts the number of words in the file “/etc/fstab”

USING: io.encodings.ascii io io.files prettyprint splitting sequences ;
"/etc/fstab" ascii file-contents " \n\t" split length .

See also

Official api docs.

Advertisements

Entry filed under: code samples. Tags: , , .

De-nesting decorators in python Automatically loading a truecrypt share at startup

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


April 2009
M T W T F S S
« Mar   May »
 12345
6789101112
13141516171819
20212223242526
27282930  

%d bloggers like this: