diff --git a/tren.rst b/tren.rst index 8766f4d..00870d4 100644 --- a/tren.rst +++ b/tren.rst @@ -1407,7 +1407,69 @@ releases of **tren** may add more of these, so it's good to periodically reread this material. -File Attribute renaming tokens +How **tren** Uses File Metadata +================================ + +Files and directories have so-called "metadata" associated with them +like who owns them, how long they are, what date they were modified, +and so on. (This information is commonly described in a data structure +called ``stat``. Even non-Unix systems like Windows have some version +of this data structure.) + +The file attribute- and sequence renaming tokens are built on this +metadata, so it's worth taking a moment to understand just *how* +it is used. **tren** keeps track of the following information +for every file- or directory you've named on the command line: + + - The order the file appears on *the command line* + - The order the file appears *alphabetically* + - The *original name* of the file before any renaming took place + - The date/time it was last *accessed* + - The date/time it was last *modified* + - The date/time it's directory entry (inode) was last *modified* + - The *inode number* for the file + - The *device number* where the directory entry (inode) lives + - The *numeric group ID* the file belongs to + - The *name of the group* the file belongs to + - The *numeric user ID* of the file owner + - The *name of the user* that owns the file + - The *mode or permissions* for the file + - The *number of links* to the file + - The *size* of the file + + +**tren** uses this information to resolve file attribute renaming +tokens, compute the value of a particular sequence renaming token and +so on. For example, a sequence renaming token based on group *name* +will order the sequence *alphabetically by group name* whereas one +based on *group ID* will order it numerically. + +It is likely that you'll only be interested in a small subset of +these. For completness, though, **tren** keeps track of all the +metadata available about the files- or directories named on the +command line and makes it available in the form of renaming tokens. + +Most commonly, you'll find yourself using the command line, +alphabetic, original name, length, and various time/date renaming +tokens. Since there are actually three different kinds of date stamps +maintained in modern filesystems, it's worth knowing the difference +between them. A good tutorial can be found here: + + http://chandynasty.blogspot.com/2007/01/difference-between-unix-mtime-ctime.html + +.. NOTE:: **tren** is portable across many operating systems because + it is written in the Python programming language. Python + *mostly* works the exact same way everywhere. However, + Windows presents some problems because it does not quite + work the same way as Unix-derived OSs do. In particular, if + you need to make use of the User/Group ID/Name renaming + tokens on Windows, consider installing the ``win32all`` + extensions to your Windows Python installation. If you + don't, **tren** will base its order on the generic names + "WindowsUser" and "WindowsGroup". + + +File Attribute Renaming Tokens ============================== These tokens are derived from information about the file or @@ -1794,7 +1856,7 @@ :: - $Id: tren.rst,v 1.159 2010/03/29 17:40:19 tundra Exp $ + $Id: tren.rst,v 1.160 2010/03/29 18:44:06 tundra Exp $ You can find the latest version of this program at: