GENERAL OPTIONS


The following options control such things as recursion, type of objects to be renamed, mode of operation and console output. These options affect all selectors and actions that are to be performed.

ALL
RLEVEL
SLEVEL
NOPAT
DIRPAT
FILES
DIRS
ICONS
NOAUTOCONFLICT
TOCD
SELECTED
SIMULATE
NOWARN
QUIETR
QUIET
STATS




ALL :



Sets full recursion. All directories and subdirectories will be processed.

Example:

> SRename "Games/a#?" ALL LOWER

Makes all files in "Games" that begin with "a" lowercase in all subdirectories.




RLEVEL (RL) <recursion level value> :


Sets the level of recursion. With a value of 1 only subdirectories in the current directory will be processed.
The default recursion level is 0 (no recursion).

Example:

> SRename "Games/a#?" RLEVEL 3 LOWER

Makes all files in "Games" that begin with "a" and in subdirectories up to 3 levels deep lowercase.




SLEVEL (SL) <starting level value> :



Sets the starting level of recursion. Files and directories in a level lower than the specified will not be processed. Also sets full recursion if a RLEVEL parameter is not given. The default starting level is 1.
Note that the value of SLEVEL can not be greater than the value of RLEVEL.

Example:

> SRename "SYS:" SLEVEL 2 UPPER

Makes all filenames in "SYS:" uppercase except for the filenames in the root directory.




NOPAT (NOP) :


Disables pattern matching. Can be useful when dealing with filenames that may contain characters used in pattern matching.
Such filenames can activate pattern matching inadvertently which can cause the renaming of more files than those selected.

For example you have files: "test10" "test11" and "test1?" and you want to rename "test1?":

Result without NOPAT: (pattern matching is activated)

> SRename "test1?" INSERT "old_"
"test10" renamed as "old_test10"
"test11" renamed as "old_test11"
"test1?" renamed as "old_test1?"

Result with NOPAT:

> SRename "test1?" NOPAT INSERT "old_"
"test1?" renamed as "old_test1?"




DIRPAT (DP) <wildcard pattern> :


Secondary arguments:

ANDROOT (AR)
ANDDIRNAME (ADN)

Determines which directories in a given path are to be entered to have their contents renamed. This option activates full recursion if ALL or RLEVEL have not been used to set the recursion level. The pattern given with DIRPAT will be used for every directory that is found.

Examples:

> SRename "Data/#?z" DIRPAT "project#?" SUFFIX DELETE

Removes the suffix from filenames that end in "z" in every subdirectory in "Data" that begins with "project". Filenames in "Data" will not be renamed.


> SRename "SYS:Data/#?z" DIRPAT "project#?" RLEVEL 1 SUFFIX DELETE

Same as the previous example but only affects filenames in subdirectories of "Data" because recursion level is 1.



Usage of secondary arguments:


ANDROOT (AR) :

Causes the filenames in the starting (root) directory to also be renamed.

Example:

> SRename "Data/#?z" DIRPAT "project#?" ANDROOT SUFFIX DELETE

Removes the suffix from filenames that end in "z" in every subdirectory in "Data" that begins with "project", and in the "Data" directory itself.



ANDDIRNAME (ADN) :

Causes the names of entered directories to also be renamed. Note that when this argument is given the name of the entered directory is modified even if it doesn't match the given filepattern, it is modified because it matches the given directory pattern.

Example:

> SRename "Data/#?z" DIRPAT "project#?" ANDDIRNAME SUFFIX DELETE

Removes the suffix from filenames that end in "z" in every subdirectory in "Data" that begins with "project". The names of the subdirectories will also be modified.




FILES (FL) :



Only files are renamed, directory names are not modified.

Example:

> SRename "Work/Data/" FILES UPPER

Makes all the filenames in "Work/Data" uppercase. Directory names are not renamed.




DIRS (DR) :



Only directories are renamed, normal filenames are not modified. If both FILES and DIRS are given only FILES will remain active.

Example:

> SRename "Work/Data" DIRS LOWER

Makes all the directory names in "Work/Data" lowercase. Filenames are not renamed.




ICONS (IC) :



Icon files (with ".info" suffix) are selected and renamed together with their file counterparts.
This option should always be used when renaming files that have icons, otherwise the ".info" suffix could be modified in an unwanted way depending on the rename operations to be performed.
ICONS is activated automatically when using the Directory Opus button bank and the active lister is in Icon or Icon action mode.

Examples:

>SRename "Pictures/" INSERT "_Pic" APPEND
"Seascape.info" renamed as "Seascape.info_Pic"
"Seascape" renamed as "Seascape_Pic"

As you see in this example because ICONS is not used "_Pic" is appended to the whole filename including the ".info" suffix, which results in the icons not appearing on Workbench.


>SRename "Pictures/" ICONS INSERT "_Pic" APPEND
"Seascape.info" renamed as "Seascape_Pic.info"
"Seascape" renamed as "Seascape_Pic"

Now with ICONS used the ".info" suffix is ignored and both files are renamed in the proper way as far as Workbench is concerned.


> SRename "tools/lacer" "tools/prepcard" ICONS UPPER
"lacer" renamed as "LACER"
"lacer.info" renamed as "LACER.info"
"prepcard" renamed as "PREPCARD"
"prepcard.info" renamed as "PREPCARD.info"

Makes "lacer" and "prepcard" uppercase including their icon's filenames.


> SRename "picture1" ICONS RENUMBER 10
"picture1" renamed as "picture10"
"picture1.info" renamed as "picture10.info"
"picture2" renamed as "picture11"
"picture2.info" renamed as "picture11.info"
"picture3" renamed as "picture12"
"picture3.info" renamed as "picture12.info"
   .... 

Renumbers files from picture1 and up including their icons.




NOAUTOCONFLICT (NAC) :


This option disables the automatic handling of filename conflicts. When renaming a file to an already existing filename, an underscore followed by a number is appended to the resulting filename to avoid the conflict.
For example, if the file "xyz" exists and SRename happens to produce that same filename then instead of failing to rename that file it will rename it as "xyz_1".
If "xyz_1" already exists as well then it will rename the file as "xyz_2" and so on.




TOCD (CD) :


Causes the files being renamed to be moved to the current CD if it's on the same volume as the files renamed.

Example:

> SRename "text/" TOCD UPPER

Makes filenames in "text" upprcase and moves them to the current dir.




SELECTED (SE) :



This option will make SRename only display the filenames that are going to be selected for renaming according to the supplied actions and selectors. It is not certain that the selected filenames will be modified.
This option was added to make it easier to find filenames that match specific criteria. It is recommended that you also give the QUIETR (QR) option when using recursion to obtain a more readable output.
Note that it is not necessary to also give an action with the selectors but also giving an action makes SELECTED more accurate in reporting which filenames will be renamed.

Examples:

> SRename "C:S#?" SELECTED MATCH "c"
Selected "Search"
Selected "SetClock"
Selected "SetPatch"

The selected filenames should begin with "S" and contain "c".


> SRename "Miscfiles/" SELECTED SUFFIX
Selected "startup.iff"
Selected "readme.txt"
Selected "boing.8svx"
Selected "Default.cfg"

The selected filenames should have a suffix.




SIMULATE (SM) :



This option will disable real renaming and the resulting filenames or comments will just be displayed. The resulting filenames or comments will not be entirely accurate because the filesystem that is used ultimately affects the final form of the filenames, and since no real renaming is done it's effect will not be shown.
It is recommended that you also give the QUIETR (QR) option when using recursion to obtain a more readable output.

Example:

> SRename "C:" SIMULATE CONV8+3
"AddBuffers" would be renamed as "ADDBUFFE"
"AddDataTypes" would be renamed as "ADDDATAT"
"Assign" would be renamed as "ASSIGN"
"Avail" would be renamed as "AVAIL"
"BindDrivers" would be renamed as "BINDDRIV"
"Break" would be renamed as "BREAK"
"ChangeTaskPri" would be renamed as "CHANGETA"
"ConClip" would be renamed as "CONCLIP"
"Copy" would be renamed as "COPY"
"CPU" would not be changed
  ....




NOWARN (NW) :



Suppresses warning message output. Warnings are displayed when minor issues are detected when parsing the instructions given.




QUIETR (QR) :



If given this option stops the directory name that is currently being processed during recursion from being displayed. This can reduce the time required for the renaming operation quite a lot in low powered systems.

Example:

SRename "libs:z#?" ALL UPPER

rtg/
rtgc2p/
libs2/
"zlib.library" renamed as "ZLIB.LIBRARY"

xad/
"Zoom" renamed as "ZOOM"
"ZAP" not changed

xfd/
"ZbL!" renamed as "ZBL!"
"ZeroPacker" renamed as "ZEROPACKER"

Picasso96/
compressors/


Now the output of the same command with QUIETR given:

SRename "libs:z#?" QUIETR ALL UPPER

AmigaOS:Libs/libs2/
"zlib.library" renamed as "ZLIB.LIBRARY"

AmigaOS:Libs/xad/
"Zoom" renamed as "ZOOM"
"ZAP" not changed

AmigaOS:Libs/xfd/
"ZbL!" renamed as "ZBL!"
"ZeroPacker" renamed as "ZEROPACKER"




QUIET (Q) :



Suppresses all output except error messages. This option is ignored when SELECTED or SIMULATE is also given.




STATS (STA) :


Displays statistics about the rename operations that have been carried out. These are :

- Directories scanned : (if recursion used, including the root dir) - Number of directories that were scanned but not necessarily processed for renaming.

- Filenames processed : (if recursion or wildcards used) - Number of filenames that were processed for renaming but not necessarily renamed.

- Directory names processed : (if recursion or wildcards used) - Number of directory names that were processed for renaming but not necessarily renamed.

- Files renamed : Total number of renamed files.

- Directories renamed : Total number of renamed directories.

- File comments changed : Total number of modified file comments.

- Directory comments changed : Total number of modified directory comments.

- Time taken : (in seconds)

- Objects per second processed : (if time taken at least a second) - Number of file and/or directory names or comments that were processed per second.

- Objects per second renamed : (if time taken at least a second) - Number of file or directory names that were renamed per second.

- Object comments per second changed : (if time taken at least a second) - Number of file or directory comments that were changed per second.

- Percentage of processed objects that were renamed : The percentage of processed file and directory names that were renamed.

- Percentage of processed comments that were changed : Note that the number of processed comments is always equal to the number of processed objects (filenames+dirnames).