diff --git a/tren.rst b/tren.rst index ab48b7e..6763785 100644 --- a/tren.rst +++ b/tren.rst @@ -1565,106 +1565,45 @@ directory being renamed. -DEV -FNAME -GID -GROUP -INODE -MODE -NLINK -SIZE -UID -USER +``/DEV/ What This Is`` + Explanation -``/D/ File or directory creation date`` +``/FNAME/ What This Is`` - This token is replaced with the date of creation - of the file or directory being renamed. It is - in ``yyyymmdd`` format. + Explanation -``/dd/ File or directory day of creation`` +``/GID/ What This Is`` - This token is replaced with the the day of the month the - file was created in ``dd`` format. + Explanation -``/dy/ File or directory day of creation`` +``/GROUP/ What This Is`` - This token is replaced with the the name of the day the - file was created in ``Ddd`` format. + Explanation -``/E/ Original File Extension`` +``/INODE/ What This Is`` - This token is replaced the "extension" portion of the file - or directory before renaming. This does not include the - extension separator string. + Explanation -``/F/ Original File Name`` +``/MODE/ What This Is`` - This token is replaced the "name" portion of the file or - directory before renaming. + Explanation -.. NOTE:: Notice that there is no token for the *whole* filename - because you can always synthesize it with ``/F/./E/`` +``/NLINK/ What This Is`` + Explanation -``/G/ File or directory primary group name`` +``/SIZE/ What This Is`` - This token is replaced with the name of the - primary group to which the file belongs. + Explanation -``/hh/ File or directory hour of creation`` +``/UID/ What This Is`` - This token is replaced with the hour the file was - created in ``hh`` format. + Explanation -``/I/ File or directory creation date in ISO format`` +``/USER/ What This Is`` - This token is replaced with the date of creation of the - file or directory being renamed. It is similar to ``/D/`` - except it is in ISO format, ``YYYY-MM-DD``. - -``/L/ File or directory length`` - - This token is replaced with a numeric string - that indicates the length of the file or directory - in bytes. - -``/mm/ File or directory minutes of creation`` - - This token is replaced with the minutes the file was - created in ``mm`` format. - -``/mo/ File or directory month of creation`` - - This token is replaced with the numeric month the file was - created in ``mm`` format. - -``/my/ File or directory month of creation`` - - This token is replaced with the abbreviated name of the - month the file was created in ``Mmm`` format. - -``/ss/ File or directory seconds of creation`` - - This token is replaced with the seconds the file was - created in ``ss`` format. - -``/T/ File or directory creation time`` - - This token is replaced with the time of creation of the - file or directory being renamed. It is in ``hh:mm:ss`` - format. This is equivalent to ``/hh/:/mm/:/ss/``. - -``/U/ File or directory owner name`` - - This token is replaced with the name of the - file or directory's owner. - -``/yyyy/ File or directory year of creation`` - - This token is replaced with the year the file was - created in ``yyyy`` format. + Explanation Time-Related Attribute Renaming Tokens @@ -1691,35 +1630,43 @@ This is updated whenever the file- or directory itself is modified. **tren** implements a set of time-related file attribute renaming -tokens intended to provide full access to these various timestamps. +tokens intended to provide full access to these various timestamps. They +are identically named, except that the first letter of each of the +time-related attribute tokens indicates which of the three timestamps +above is used to compute the value: +``/ADAY/, /CDAY/, /MDAY/ What This Is`` + Explanation -ADAY -AHOUR -AMIN -AMON -AMONTH -ASEC -AWDAY -AYEAR -CDAY -CHOUR -CMIN -CMON -CMONTH -CSEC -CWDAY -CYEAR -MDAY -MHOUR -MMIN -MMON -MMONTH -MSEC -MWDAY -MYEAR +``/AHOUR, /CHOUR/, /MHOUR/ What This Is`` + + Explanation + +``/AMIN/, /CMIN/, /MMIN/ What This Is`` + + Explanation + +``/AMON/, /CMON/, /MMON/ What This Is`` + + Explanation + +``/AMONT, /CMONTH/, /MMONTH/ What This Is`` + + Explanation + +``/ASEC/, /CSEC/, /MSEC/ What This Is`` + + Explanation + +``/AWDAY, /CWDAY/, /MWDAY/ What This Is`` + + Explanation + +``/AYEAR, /CYEAR/, /MYEAR/ What This Is`` + + Explanation System Renaming Tokens @@ -1941,25 +1888,6 @@ Types Of Sequence Renaming Tokens ================================= - -ADATE -ATIME -CDATE -CMDLINE -CTIME -DEV -FNAME -GID -GROUP -INODE -MDATE -MODE -MTIME -NLINK -SIZE -UID -USER - Sequence renaming tokens are thus a way to generate an ordering *based on some property common to everything being renamed*. Keep in mind that for purposes of sequencing, **tren** *makes no distinction @@ -1968,92 +1896,73 @@ **tren** currently supports the following kinds of sequencing: +``/+-ADATE:Alphabet:FormatField/ Sequence based on`` - ``/+D0001/ Sequence based on the creation date/time`` + Explanation + +``/+-ATIME:Alphabet:FormatField/ Sequence based on`` - This produces a sequence from oldest to newest - (or the reverse) of the renamed objects. + Explanation - ``tren.py -b -r =/+D0002/ *.txt`` +``/+-CDATE:Alphabet:FormatField/ Sequence based on`` - This would rename all the files in the current - directory into the form, ``0002.txt``, ``0003.txt``, - ... ``9999.txt`` with ``0002.txt`` being the oldest - file and ``9999.txt`` being the newest. If you - used the token ``/-D0002/``, you'd get the same - thing, but in reverse order. + Explanation - ``/+L0001/ Sequence based on the size of the files being renamed`` +``/+-CMDLINE:Alphabet:FormatField/ Sequence based on`` - This produces a sequence from shortest to longest - (or the reverse) of the renamed objects. + Explanation - ``tren.py -r =/+L0002/ *.txt`` +``/+-CTIME:Alphabet:FormatField/ Sequence based on`` - This would rename all the files in the current - directory into the form, ``0002.txt``, ``0003.txt``, - ... ``9999.txt`` with ``0002.txt`` being the shortest - file and ``9999.txt`` being the longest. If you - used the token ``/-L0002/``, you'd get the same - thing, but in reverse order. + Explanation - ``/+R0001/ Sequence based on the file order on the command line`` +``/+-DEV:Alphabet:FormatField/ Sequence based on`` - This produces a sequence based on the order (or the - reverse) of renaming - i.e., The order of the names - on the command line. + Explanation - ``tren.py -e -r =/+R0000/ MyFile.txt AFile.jpg me.log`` +``/+-FNAME:Alphabet:FormatField/ Sequence based on`` - This would rename all the files to, ``MyFile.0``, - ``AFile.1``, and ``me.2``. If you used ``/-R0000/``, - you'd get ``MyFile.2``, ``AFile.1```, and ``me.0``. + Explanation - ``/+T0001/ Sequence based on creation time within date`` +``/+-GID:Alphabet:FormatField/ Sequence based on`` - This produces a sequence based on the creation date - and time similar to the ``/+D.../`` sequence renaming - token above. However, the sequence *resets* at the - beginning of each new date. This allows you to - create unique sequences *within a date* like our - example of renaming photo files from different - cameras. (See: `An Overview Of Renaming Tokens`_):: - - - tren.py -b -r =/D/-/+T0100/ *.txt + Explanation - This would rename all the ``.txt`` files in the current - directory into the form:: +``/+-GROUP:Alphabet:FormatField/ Sequence based on`` - 200103010-0100.txt - 200103010-0101.txt - 200103010-0102.txt - 200104010-0100.txt - 200104010-0101.txt - 200104010-0102.txt - 200104011-0100.txt - 200104011-0101.txt - 200104011-0102.txt - ... + Explanation - In other words, instead of sequence just on the creation date, - this allows us to sequence *within* the date. As always, the - ``-`` flag will reverse this order within the date. +``/+-INODE:Alphabet:FormatField/ Sequence based on`` - Notice that you can get something similar using just - file attribute renaming tokens:: + Explanation - tren.py -b -r =/D/-/T/ *.txt +``/+-MDATE:Alphabet:FormatField/ Sequence based on`` - This would produce names in the form:: + Explanation - 200103010-03:01:23.txt - 200103010-03:01:24.txt - 200103010-03:01:25.txt - ... +``/+-MODE:Alphabet:FormatField/ Sequence based on`` - For most purposes, though, the order, rather than the - absolute time is both more useful and more readable. + Explanation + +``/+-MTIME:Alphabet:FormatField/ Sequence based on`` + + Explanation + +``/+-NLINK:Alphabet:FormatField/ Sequence based on`` + + Explanation + +``/+-SIZE:Alphabet:FormatField/ Sequence based on`` + + Explanation + +``/+-UID :Alphabet:FormatField/ Sequence based on`` + + Explanation + +``/+-USER:Alphabet:FormatField/ Sequence based on`` + + Explanation BUGS, MISFEATURES, OTHER @@ -2122,7 +2031,7 @@ :: - $Id: tren.rst,v 1.167 2010/04/01 21:14:44 tundra Exp $ + $Id: tren.rst,v 1.168 2010/04/01 21:55:53 tundra Exp $ You can find the latest version of this program at: