finds.dev← search

// the find

dheadshot/RenameFilesForWeb

★ 2 · C · updated Jan 2022

RenameFileForWeb is a little program to strip special characters out of filenames in preparation for being uploaded to Microsoft SharePoint.

rffw is a small Windows command-line tool written in C. It strips &, #, @, + and backslash from filenames, optionally recursing into subdirectories, so a folder tree can be uploaded to SharePoint, which at the time rejected files with those characters. It's for someone with a one-off batch of files on Windows, not for anyone who needs a general filename sanitiser. The last push was January 2022, and the README itself says SharePoint may no longer have the limitation.

Collisions are reported in the output instead of overwriting anything, which is the right default for a tool that renames in place. The README tells you to redirect stdout to a log for that reason. Recursive mode skips directories whose names begin with a full stop, so it won't wander into .git or other tooling folders, a default most one-off scripts would miss. It depends only on kernel32 and builds with MinGW or TCC through a single make.bat, so there is no runtime or package manager involved.

The character list is hardcoded to five entries with no stated basis, and backslash can't appear in a Windows filename anyway, so there are effectively four. As I understand Microsoft's documented SharePoint restrictions, they also cover characters like ~, %, { and }, and leading or trailing spaces, none of which are handled, so check your target's rules before trusting the output. There is no dry-run mode. Renames happen as the tree is walked, so a wrong path with /r changes everything under it, and the only record is whatever was redirected to the log. The repo also commits rffw.exe and rffw.o alongside the source. The .o is a build intermediate, and the binary will drift from the source, so anyone cloning it gets an executable of unknown provenance. The version history includes a fix for a bug where only the first matching character was replaced, which suggests the string handling had little testing before release. There are no tests in the tree, and the project has two stars and one author.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →