Dont Panic

Runlevel6

Where Am I?

Runlevel 6 is an international group of like-minded individuals who have come together to learn from, and contribute to the development community.

Recent Work

Screenshot

Letterland

Modern design and UI for the digital presence of Letterland Canada.

Search and Destroy

Mail Me

Get in Touch

Get your people to call our people. We'll do lunch sometime.

Case Sensitive to Insensitive

Gianni

February 14th, 2009

Today I was about to format my computer, but first I had to backup my files. So I dragged my home folder over to an external hard drive. Turns out the external drive was formatted as case-insensitive and my internal drive is case-sensitive (the true UNIX way). Anyway, the transfer failed because many of my files had the same name, just different case. I freaked out and thought that this would be impossible to fix. But then I remembered that I was a programmer, so I quickly wrote a couple ruby scripts to quickly find files with conflicting names.

I thought some of you might find these useful, so I’m posting them here:

casechecker

Code

Usage

./casechecker_recursive.rb /path/to/directory

PS

Never format your Mac as case-sensitive, you’ll have major compatibility issues. Trust me.

This entry was posted on Saturday, February 14th, 2009 at 11:22 pm and is filed under OS X. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


One Response to “Case Sensitive to Insensitive”

  1. Or, in a more true unix way:

    $ find . | tr ‘[A-Z]‘ ‘[a-z]‘ | sort | uniq -d

    There’s probably a better way to do case folding, but you get the point.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Twitter

Follow me

Subscribe

Stay up to date with the RSS feed.

Flickr Feed