fsl / doc / index.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
        "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">

<head>
    <title>File Selection Language</title>
    <link rel="stylesheet" href="fsl.css" type="text/css">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="author" content="Kristian Ovaska">
</head>

<body>

<h1>File Selection Language</h1>

<p>
WWW: <a href="http://www.cs.helsinki.fi/u/hkovaska/fsl/">
     http://www.cs.helsinki.fi/u/hkovaska/fsl/</a> <br>
Author: <a href="http://www.cs.helsinki.fi/u/hkovaska/">Kristian Ovaska</a>
        (kristian.ovaska [at] helsinki.fi) <br>
License: BSD<br>
Version: 0.5.1 (2005-12-05)<br>
Requirements: Python 2.3 or greater<br>
Platforms: Unix, Windows

<p>
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.

<p>
Report bugs, send suggestions and give feedback to the author.

<p>
See documentation:
<ul>
<li><a href="language.html">File Selection Language Reference</a>
<li><a href="fsltool.html">fsltool</a> usage (command-line tool)
<li><a href="changelog.html">Change log</a>
<li><a href="bugs.txt">Bug database</a>
</ul>

<!-- UNCOMMENT for WWW index
<h2 id="download">Download</h2>

<table>
<tr>
  <th>Version
  <th>File
  <th>Size
  <th>MD5
<tr>
  <td>FSL 0.5
  <td><a href="fsl-0.5.zip">fsl-0.5.zip</a>
  <td>72 KB
  <td>2d5888b27f66889ceb99732ca798243c
<tr>
  <td><b>FSL 0.5.1</b>
  <td><a href="fsl-0.5.1.zip">fsl-0.5.1.zip</a>
  <td>72 KB
  <td>-
</table>
-->

<h2>Example</h2>

<pre class="code">
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) &gt 1000000 OR extract(date(f), "year") = 2001
</pre>

<p>
This example program:
<ul>
<li>Includes all <tt>*.gif</tt>, <tt>*.jpg</tt>, <tt>*.png</tt> files
    under <tt>/home</tt> (and its subdirectories)
<li>Includes <tt>*.ps</tt>, <tt>*.eps</tt> files under
    <tt>/home/alfred</tt> (and its subdirectories) that have been
    modified in the past year
<li>Includes <tt>*.pdf</tt> files located in <tt>/home/alfred</tt>, but
    not in any subdirectories of <tt>/home/alfred</tt>
<li>Includes all files under <tt>/usr</tt> ...
<li>... except <tt>*.sh</tt> files under <tt>/usr/local</tt>
    (in any subdirectory)
<li>Excludes all files beginning with <tt>a</tt> with size
    greater than 1,000,000 bytes or modification date in the year 2001.
    This rule applies to all files that were matched above.
</ul>

<h2>Features</h2>

<p>
FSL can be used with a command line tool (<a href="fsltool.html">fsltool</a>)
or, for Python programmers, with a programmable interface. For the Python
interface, see the documentation of <tt>Interpreter.py</tt>.

<p>
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.

<p>
Support for both Windows-like and Unix-like paths.

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

<h2>Installation</h2>

<ol>
<li>Download FSL
<li>Unpack the archive
<li>Install FSL:
    <ul>
        <li>If you have Python 2.4 or greater, and you want to install
            automatically, run <code>python setup.py install</code>.
            This installs FSL into your <tt>site-packages</tt> directory.
            You must have write permissions under <tt>site-packages</tt>.
        <li>If you have Python 2.3, you must install manually.
            If you plan to use FSL from the command line interface only,
            copy the FSL file tree into any directory of your choosing.
            If you plan to use FSL as a Python module as well,
            copy the fsl/ directory somewhere on your Python search
            path. To make sure you installed FSL correctly on the search
            path, execute <code>import fsl.fsltool</code> in a Python
            session.
    </ul>
<li>Test that the installation works by executing <code>testall.py</code>
    under <tt>fsl/test/</tt>. The tests take some time to finish.
    Expected result: <em>one</em> test fails
    (<code>test_lexer.TestLexer.test_invalid</code>), 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.
<li>Next, you can start playing with fsltool (<tt>fsl/fsltool.py</tt>)
</ol>

<p>
<hr>
Updated 2005-12-04
</body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.