File Selection Language

WWW: http://www.cs.helsinki.fi/u/hkovaska/fsl/
Author: Kristian Ovaska (kristian.ovaska [at] helsinki.fi)
License: BSD
Version: 0.5 (2005-10-21)
Requirements: Python 2.3 or greater
Platforms: Unix, Windows

File Selection Language (FSL) is a descriptive language for file selection. It is used to selectively pick files from a directory structure. FSL is useful for selective backups, for instance. FSL uses glob patterns as the basic building block. For fine-tuning the selection, inclusion/exclusion rule combinations and conditional expressions are available. File size and modification date can be used in expressions.

See documentation:

Example

IN home
    *.gif, *.jpg, *.png
    IN alfred
        EACH f IN *.ps, *.eps IF age(f) < 365
        *.pdf NONREC   # non-recursive

usr
NOT usr/local/*.sh

NOT EACH f IN a* IF size(f) > 1000000 OR extract(date(f), "year") = 2001

This example program:

Features

FSL can be used with a command line tool (fsltool) or, for Python programmers, with a programmable interface. For the Python interface, see the documentation of Interpreter.py.

Several FSL rule files can be combined in a cascading manner similar to CSS. The effect is the same as if the rule files were pasted into a single file.

Support for both Windows-like and Unix-like paths.

Strict parse-time type checking to catch as many errors as possible before run-time. For example, you can't say EACH f IF size(5) > 1000 because function size expects filename argument.

Installation

  1. Download FSL
  2. Unpack the archive
  3. Install FSL:
  4. Test that the installation works by executing testall.py under fsl/test/. The tests take some time to finish. Expected result: one test fails (test_lexer.TestLexer.test_invalid), all others pass. If you get this result, you can assume the program is installed correctly. If more tests fail, try to see if there is something obviously wrong with the installation or environment; if not, contact the author.
  5. Next, you can start playing with fsltool (fsl/fsltool.py)


Updated 2005-10-21