Colon Files: rsync-tr

I was copying over some music to my phone (via jmtpfs and rsync), and I noticed that some of the files failed with “Input/output error”:

After a while it dawned on me what all these files had in common was that there’s a colon in the file names. And presumably the MicroSD card in the phone uses a VFAT file system, and those file systems don’t like colons in the file names at all.

So I thought: Surely there’s a simple switch I can give to rsync to translate file name characters. I mean, this problem can’t be that obscure: We’ve been copying media files to devices that use VFAT file systems for decades now.

But after reading the man page and Googling for hours: rsync doesn’t support this. I mean, I can somewhat understand why. Whatever you’re doing is going to be pretty hackish. You could get file name collisions or inconsistent rsyncs, perhaps. On the other hand, these devices are the end point for these files: We don’t really care much about the names…

It turns out that Matt McCutchen wrote a patch in 2007 that was never accepted. It adds a simple –tr :/- syntax that does exactly what I need.

The patch no longer applies cleanly, but it’s surprising how little work was needed to shoehorn it into the current rsync source code. They’ve obviously retained the basic structure of the files and the repo, for which I am thankful.

I put the resulting git fork up on Microsoft Github.

And there’s a few other gotchas when rsyncing to VFAT: It doesn’t support all the Linux file system flags or renaming in the way rsync does by default, so for reference, here’s the complete command line I ended up with that will (sort of) reliably copy over new files to my phone:

~/src/rsync/rsync -atvL \
  --tr ':?"/-!' --inplace \
  --ignore-existing \
  /music/picks/ /mnt/sony/SD\ card/Android/music/

Your mileage will vary.

wordpress.com is annoying

I’ve got some blogs hosted on wordpress.com, and when I looked at the stats for one of them today, this thing popped up:

Wha… My blog isn’t “set up” unless I signed up for some weird Google product?

When I click on that link I get this:

There’s no way to say “I don’t fucking care about any of this”.

So now I guess I just have to live with half the screen on the stats page being taken up by a Google ad without any way to make it go away.

What the fuck, WordPress.com? These are the offputting upsell strategies expected of corporations like Network Solutions (who anybody sensible have severed ties with); not of Automattic.

unsilence

Hidden tracks on CDs used to be a pretty common thing. Not “real” hidden tracks: You could play tricks with the directory structure and put a track before the first one, so you have to skip back from 1 to get to 0.

No, the common way to do this is to pad the final track with, say, ten minutes of silence, and then the “hidden” song starts.

While the concept of hidden tracks is fun, in practice it’s really annoying, because it means that you’re sitting there listening to silence for ten minutes.

So once upon a time I wrote a little C program that would look for silences in the last track of all the CDs I have ripped, and if it finds (long) silences, then splitting happens.

As CDs are getting less popular as a means of distribution (to put it mildly), the hidden track thing has all but disappeared, too, but this week I got
the new Deathcrush album, and it employs this tactic.

I started looking around for the scripts to split the file, and then I discovered that it was in an obscure region of my home directory, not touched for ten years, and not put on Microsoft Github.

But now it is.

It’s probably a couple of decades too late to be useful to anybody, but there you go. It compiles and everything on the current Debian, which just amazes me. I mean, I wrote it in… like… 2003?

Go Linux.