While copying files to an external hard drive with a bum cable using my Mac’s Finder to move the files I ended up with an accidentally half-copied folder that was grayed out and I couldn’t open it at all. I could go into Terminal and access it that way, but Finder was a dead duck. Even after I properly unmounted and remounted the drive it didn’t work. I putzed about for a while searching for a solution and the general answer most people have is to use the ‘cat’ command to copy the files elsewhere and just be done with it. This didn’t sit well with me, there should be a way to correct the situation without having to duplicate the folder or copy the files or do anything laborious like that – and it turns out there is just that.
The folder had a creation time of some date in 1984. Probably the first possible date for OSX knowing Apple. They initiated the folder but since the move was interrupted the later adjustment never got made. This is a bug, Apple. Anyways, how to correct it? Some people seemed to think that the ‘touch’ command could possibly do the trick, but touch can’t really get to all the dates that come with files in the HFS file system. This folder, for examples sake I’ll just call it “folder” had displayed this 1984 date as it’s creation date. The touch command was successful in mangling all the other dates, except for the specific one I was after. I used the ‘stat’ command on the folder and discovered that the st_birthtime of the folder was 1984. How in the hell do you change that date?
I found out that you need another utility to do it properly. You need to download the Command Line Tools for XCode, which is the development platform for the OSX Operating System. It’s free and easy to install. Once you do that, you will get a new command to use in the terminal called SetFile. So here’s how to fix this problem if you run into it: SetFile -d [todays date][file or folder] and press enter. So for my file, it would be SetFile -d 08/17/2013 folder/ and press Enter. Voila! Folder is real and not-grayed and Finder thinks it’s just peachy keen.
So for anyone with grayed out folders, check your dates. Use the stat command, download the XCode CLI tools and use SetFile to rescue your folder or file from inaccessible hell.