Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 1.69 KB

README.md

File metadata and controls

30 lines (18 loc) · 1.69 KB

sanato

MacOSX (command line) program that allows you to sanitizes file/directory names which are invalid under SMB Shares. This program runs recursively from current working directory looking for file or directory names that includes any of the WARNING or MUST-SWAP characters, if any of the "WARNING" chars are found they will be logged, if any of the MUST-SWAP are found AND the '-s' option is present then those chars in the path will be swapped by '-'.

Usage: sanato [OPTIONS] <argument> [...]
   -s, --sanitize                Rename last path components
   -v, --verbose                 Increase verbosity
   --version                     Display version and exit
   -h, --help                    Display this help and exit

Looks for the following sets of characters:

WARNING SET     |?*<":>/
MUST-SWAP SET   :?

Installation and Usage

Download sanato-1.03.zip or download this repo and compile with XCode. Place the executable into your PATH. Open a terminal session and run in any of your directories. First without arguments so it will run in dryrun mode, telling you what it would do without doing it. When you are ready and happy with the tentative renamings then just run it with -s option.

Disclaimer

This is extremely destructive software, renaming files can be very dangerous as it may rename files under BUNDLE's or Application Bundles in MACOSX. Please use it only if you know what you are doing. The objective of this program was to sanitizes invalid filenames inside directories in remote SMB shares.

LICENSE

Licensed under The MIT license