6f4087cb6b/library/files.retro
| 43fd6a76ba79839cb7b101945b85dac8dd07f9aa | 6f4087cb6b11c592278ebb86b5b90cc298e3c857 | ||
|---|---|---|---|
4 | ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) | 4 | ( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) |
5 | ' files open | 5 | ' files open |
6 | 6 | ||
7 | : fread! ( ha-f ) swap fread dup rot ! ; | ||
8 | |||
7 | : slurp ( a"- ) | 9 | : slurp ( a"- ) |
8 | :r fopen dup | 10 | :r fopen dup |
9 | if | 11 | if |
10 | swap repeat 2dup fread not if 0 swap ! fclose drop ;then 1+ again | 12 | swap repeat 2dup fread! 0 =if 0 swap ! fclose drop ;then 1+ again |
11 | else | 13 | else |
12 | drop 0 swap ! | 14 | drop 0 swap ! |
13 | then ; | 15 | then ; |
Download diff