Grayed Folders in Macintosh OSX

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.

14 thoughts on “Grayed Folders in Macintosh OSX

  1. I can stop banging my head on the wall now – THANKS! I opted for the App on the App Store called “File Mod” which does it via GUI, and set the creation date to the last modified date. It’s a bit easier (and lazier) to click on a date that has already been prepared for you, than confusing the UK/US date formats 🙂

  2. File Date Changer 5 and File Multi Tool 5 by publicspace.net are also available on the App Store, but are slightly more expensive (and more powerful) options.

  3. Pingback: Empower non-admin users to change a file or directory’s creation date with command-line tools and your deployment solution | techstuff

  4. I’m getting ERROR: File Not Found. (-43) on File:

    I have a greyed out movie file in my movies folder in Finder user/movies/
    I also have a greyed out .dmg FCPX on my desktop.
    I tried your way “SetFile -d 08/17/2013 folder/ and press Enter”
    I tried typing in all paths, still nothing.
    Any suggestions ?

    • If you accidentally entered the absolute path from the root then it’ll likely always fail. If we’re working in your user folder on your Mac, say /username/movies or /username/Desktop then you can use the tilde character to represent the entire path of your user folder. Start Terminal as yourself, so when you type in whoami and press enter you should see your username. So the command to use would be SetFile -d 08/17/2013 ~/movies/mymoviefile.mp4 or SetFile -d 08/17/2013 ~/Desktop/DiskImage.dmg/ . Let me know if it works out for you or not. Sorry for the delay in replying.

  5. I was able to fix this via just copying the contents of the folder to another via Terminal.
    mkdir Foldername2
    cp -r Foldername1 Foldername2

    Then on another mirrored drive with the same folder, I’m trying just a command-D duplicate in Finder and that seems to be working as well.

    Just posting alt solutions for others. 🙂

  6. 1) You have to sign in with your Apple ID at developer.apple.com and fill out a small registration form in order to download “Command Line Tools for XCode”
    2) Once installed, launch Terminal and type: setfile -d 03/14/2015
    3) For files or folders with spaces in their name, save typing the path by dragging the file or folder into the terminal window (don’t forget to type a space after the date or before the file path). This will easily and automatically insert the path with the appropriate syntax.

    Thanks for providing the fix, @BlueDepth!

  7. Pingback: Apple:External drive error while moving files, now folder is inaccessible from Finder – Apple Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.