Script Library: 1238 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

Documentation for: sizedir.r

Usage document for %sizedir.r

1. Introduction to %sizedir.r

This script is a handy tool that displays the total size of all %.r files in a directory.

2. sizedir At a Glance

 >> do
 connecting to:
 Script: "Total Size of .r Files" (24-Apr-1999)
 58475 bytes

3. Using %sizedir.r

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.

3.1. Running %sizedir.r

This utility is simple to use. Just DO it.

 >> do %sizedir.r

This can be executed directly from the library

 >> do
and will give you information on the %.r files in the current default directory.

4. What you can learn

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.

5. What can break

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.

6. Credits

%sizedir.r Original author: Unknown
  • The Library Team
  • Usage document by Brian Tiffin, Library Team Apprentice, Last updated: 5-May-2007