This script is a handy tool that displays the total size of all %.r files in a directory.
>> do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=sizedir.r connecting to: www.rebol.org Script: "Total Size of .r Files" (24-Apr-1999) 58475 bytes
There are a few change that be made to this script. You could change the directory that is scanned, and the files that are included in the total.
This utility is simple to use. Just DO it.
>> do %sizedir.r
This can be executed directly from the library
>> do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=sizedir.rand will give you information on the %.r files in the current default directory.
How REBOL can return a block of filenames by using load on a directory specification. In this example, load %./.
The REBOL size? function returns the length of a file. Note there are complexities to this in real life, as operating system filesystems usually have allocations that don't match actual file sizes. But that is a more advanced topic.
By default, REBOL security settings do not allow directory reads for most directories. Modified versions of %sizedir.r may cause a security question, unless you start up REBOL with the -s option.
%sizedir.r | Original author: Unknown |