forth scripting
Jerry Vonau
jvonau at shaw.ca
Mon Jul 23 03:18:58 EDT 2012
On Mon, 2012-07-23 at 16:03 +1000, James Cameron wrote:
Thanks, James.
> The methods I've used to check for non-empty directory are:
>
> 1. try assuming the directory is empty and if an exception occurs
> handle it, using catch,
>
> 2. try assuming the directory is non-empty and if an exception occurs
> handle it, using catch,
>
> 3. write a file counter, using the filesystem search infrastructure,
> something like $tar-add-pattern in save-power-logs.fth in
> http://dev.laptop.org/git/users/quozl/save-power-logs.git/
>
> 4. use collect( from the stringio package to redirect output to a
> string and check the string for overall length or number of lines,
> e.g.
>
> ok collect( " u:\*.zd" $dir )collect ( adr len ) nip .
>
Think I'll find that very useful, thanks for the pointers.
> The word words can display all the defined words in use in the current
> vocabulary, but this won't show you words in other vocabularies, such
> as device instances or tools. show-devs can show you the the device
> names, and then dev can bring their vocabularies into currency.
>
Thanks a bunch, to-file <path> words will make a great pocket reference
for me.
Jerry
More information about the Devel
mailing list