Subscribe to MacYourself via RSSFollow MacYourself on Twitter

Solution to Finder “Error code -36” in 10.6 when copying folders

Solution to Finder

Users of Mac OS X Snow Leopard, specifically those running 10.6.2, are experiencing a widespread problem related to copying directories to Windows-formatted volumes in Finder.

I recently got a new USB flash drive and ran into a serious issue as I was loading it with data. Some of the files I temporarily copied to my Mac’s Desktop from my old flash drive would not successfully copy to the new one. Both flash drives were formatted as FAT volumes (known as MS-DOS in Disk Utility) and only files that resided in a folder seemed to be affected. I could copy the files individually just fine, but not an entire folder at once. Finder would have none of it.

If you’re running Mac OS X 10.6.2 and have a MS-DOS/FAT-formatted disk handy, here is a quick way to replicate the problem.

  1. Create a new folder on the MS-DOS drive with Finder and copy any file from your Mac right into that folder. It could be anything… I used a random image on my Desktop, for example.
  2. Copy the entire folder from the MS-DOS drive to your Mac’s Desktop.
  3. Copy the folder from your Desktop right back onto the MS-DOS drive.

Boom! You just got slapped with the following error, didn’t you? “The Finder can’t complete the operation because some data can’t be read or written. (Error code -36).” Every time, without fail, this has occurred on all Snow Leopard machines I’ve tried. Sure, you can reformat the USB flash drive to Mac OS Extended to get around the error, but that kills Windows compatibility. Instead, let’s dig deeper.

It turns out the problem stems from the “dot-underscore” companion files that Mac OS X’s HFS+ filesystem creates for files when they get moved to FAT16 or FAT32 volumes. These hidden files – which start with “._” followed by the original filename – contain extra information to go along with the main file’s data. Apparently things get screwy in 10.6.2 and don’t go well when folders from a Windows-compatible volume get moved to a Mac and then back again. The dreaded “Error code -36” message is the result.

If you run into this horribly inconvenient bug, there is a temporary solution until Apple gets their act together. It involves stripping the main file of its unneeded dot-underscore buddy. Don’t worry, you won’t lose anything important in the process. Here’s what you can do:

  1. Launch Terminal (Applications > Utilities) and type the following command, making sure to include a space at the end:

    dot_clean

  2. Select the folder on your Mac that is giving you trouble and drag it right to the Terminal window. A green cursor with a + symbol should appear before you release the mouse.
  3. The path to that folder should have automatically appeared at the end of the Terminal command. For example, it might look like:

    dot_clean /Users/UserName/Desktop/Test_Folder

  4. Press Enter/Return to run the command. It will appear as if nothing happened, but try copying that folder to a MS-DOS volume now. Finder should magically allow it to be moved with no problem!
  5. Repeat the entire process as needed for other folders that won’t copy.

As you can see, this is not necessarily a major file or disk corruption issue. It is a pesky Snow Leopard bug that Apple will hopefully fix in the upcoming 10.6.3 update. In the meantime, this will allow users to copy and move files between drives as needed.

UPDATE – 4/4/10: Apple’s 10.6.3 update has indeed finally fixed this bug! If you installed the update and are still experiencing a Finder error, it’s likely you are suffering from a different issue that is beyond the realm of this article.

158 Comments Have Been Posted (Leave Your Response)

Thank you so much!! This has been happening to me for weeks and I had no idea what was going on. My thumb drive is happy again!

Thank You! This has been bugging me for so long!

I’m seeing this problem when I try to copy (large) files to an external drive that’s formatted as Mac OS Extended (Journaled). When I use the drive on an OS X 10.5 system, it works fine. It fails only on my 10.6.2 Mac.

I’ve reformatted the drive, and the problem persists.

Any possible explanations for this?

The dot_clean command is recursive so you don’t have to do each folder. So it’s really easy to use…

Thank you very much … certainly this problem appeared when Snow Leopard is updated to version 10.6.2 … until today, when I read in (http://discussions.info.apple.com/thread.jspa?threadID=2231572&start=90&tstart=0) solution that directs me here … thanks again for the solution clearly and accurately.

sorry to say it didn’t work, after entering the dot_clean command and trying a file, the terminal gives me the response
” -bash: /Users/Car/icons/Adobe CS4 Icons: is a directory ”
and the finder error still persists

thanks a lot for the tip. That’s great.

Thank you so much. Your explanations were simple and straight forward. I’ve subscribed to your page and look forward to learning more!

It works! thanks for the help.

Well..I did that..and the problems persists…I cannot copy the folder to the external drive..any other solution?

Wow…thank you thank you and thank you. I have been wrecking my brain on this for at least a few days now. Now finally found the solution that works.Just to clarify.
After lunched terminal, type “dot_clean ” Make sure you have space after the word dot_clean. Then drag the folder into terminal window and hit enter. Thanks again.

I can’t believe they haven’t fixed this yet. You’d think they might have snuck it in the security update last week.

Couldn’t not being able to back up files be considered a security issue?

This has been happening to me since August when I updated the OS to Leopard. I can’t thank you enough for your kind help.

This doesn’t work for me. My hard drive is formatted as Mac OS Extended (Journaled). I backed up my entire iTunes collection so that i could clean install Snow Leopard and now i can’t get it of the hard drive. The clean doesn’t seem to do anything.
As you can probably understand this is driving me crazy as i now have no music. Does anyone know any other solutions?

Legend! Been trying to figure this out for ages!

Also, following on from Oats post above you can select multiple folders and drop in to terminal, will still work.

ANT….you are the MAN!!!!
Thanks a lot, i thought i was loosing my mind and my job!!!

God bless you for digging deeper!!

THANK YOU SO MUCH THIS IS SO HELPFUL!!!! Finally able to clear away those ._ files and it Fixed the error code -36 issue I was having

This hasn’t worked for me sadly. I can back up from my iMac, transfer same files to my macbook, but when I try & back up again from the macbook then I get the error message. Both are on 10.6.2, only difference is that iMac came with it, macbook upgraded from 10.5 where this wasn’t an issue. Please please help.

FANTASTIC !!!!!!!!!
Fixed, done, easy

You are the best !

Thanks Ant! You are a deadset legend – Full Stop

Thank you, Masked Man!!

It works for:
error code -36 <–As you describe above. (It fixed a problem I had last month.)
error code -35 <–I gave it a shot … it seemed to work. (With a funny error message … which i ignored.)

Both, while trying to copy large files on/off a Windows formatted thumb-drive. (there is probably a more technical description for what happened. I don't care. It works now.)

Thanks again.

For the people having issues with this, if there are ANY spaces in the path to the directory, what you see after you do the drag into terminal, it won’t work.

For example, this:
dot_clean /Users/Car/icons/Adobe CS4 Icons
won’t work.

You need to escape those spaces, like this:
dot_clean /Users/Car/icons/Adobe\ CS4\ Icons
note the backslash before the space.

Thanks for this it explains why I can’t read files/folders on my FAT formatted NAS box. do you have any idea how I get round the fact that I can’t read anything on it now (the NAS box), unless I copy it back to my iMac’s drive?
I tried your fix, but as soon as I copy it back to the NAS box, the same Error -36 rears it’s ugly head again.

THANKS!!! SAVED US A LOT OF TIME MOVING ITUNES FILES TO A HARD DRIVE!

Thanks…It worked great.

Thank you very much! This works great!

Awesome, cheers man, this has been driving me crazy, this will keep me sane until the updaye! Good work.:)

This isn’t working for me, I’m trying to copy a few 6-8GB DMGs. It gives me the -36 right at the end of the copy. I tried running dot_clean on the parent directory of the DMGs and the DMGs themselves – no avail.

Thanks. This worked perfectly.

thank you so much, works perfectly!

I’m having the same issue as Car. When I attempt to use dot_clean, Terminal responds “/Users/James/Desktop/iTunes Music: is a directory”

Also, I checked to make sure that the spaces in the directory name were being escaped per another comment, and they are. Here’s exactly what goes on in Terminal:

James-Likeness-Mac-Pro:~ James$ dot_clean
usage: dot_clean [-fmnpsv] [–keep=[mostrecent|dotbar|native]] [directory …]
James-Likeness-Mac-Pro:~ James$ /Users/James/Desktop/iTunes\ Music
-bash: /Users/James/Desktop/iTunes Music: is a directory

Does anyone have any idea what I can do? I’ve isolated the error to being directory related – I can transfer files over without problems. Thanks!!

If the error occurs when trying to copy files to a flash drive, it is also possible to repartition the drive in Disk Utility – this wipes out everything, so don’t use this technique with flash drives when you want to retain existing content on that drive.

I LOVE YOU!!!!!! THANK YOU!

THANK YOU! This worked for me, and I’m pleased.

Thank you so much. I’ve been pulling my hair out for the last couple of days. You’ve really made my week-end! Thanks again.

Thank You Very Much! Couldn’t have said it any clearer/better. Thanks again! Wooohooo!

THANKA!

Lost a lot of time on this till the fix here.

Can’t believe Apple let such a bug be.

Bad Pathname: Not a directory
undouble /Users/anoukdc/Documents/Microsoft User Data/Archief/Soko – I’ll Kill Her kopie.mp3 failedMacBook-Pro-van-Anouk-DC:~ anoukdc$

^I always get this message. Doesn’t work for me.

NOOK,
It looks like you dragged a file into Terminal instead of a folder. This only works with folders/directories.

Thanks so much…. Worked perfectly

Thank you so much! I tried other “fixes” and they didn’t work. This worked! You just saved me tons of time in work-arounds!

Thank-you THANK-YOU!

I’m seeing a similar issue with copying folders from OS X 10.6.2 client to a Windows file share, except it’s an error -50. Any chance this might work?

Hmm, no workee for me unfortunately. I am trying to copy files out to a normal Mac volume, an external hard drive that I believe to be in good condition since I can format it writing zeroes and everything, no errors reported. But whenever I try to copy something out to it, using 10.6.2 Snow Leopard, I get a most unwelcome error -36. :(

thank you very much for sharing.
u the man.

DZUL NAJMI SIROZI
March 7th, 2010, 5:15 AM

this is really helpful .. thanks for showing this tips ..

Thank you very much. Need PC compatibility for work.

This is just one in a long list of problems I have experienced with Snow Leopard… Really wish I had never upgraded!!!

Thanks again

works! thanks ant… there are times you just really have to hate apple!!!!

THANK YOU! This totally solved my problem. Backing up right now.

James Likeness and Car, the problem you’re having is a result of hitting enter after your dot_clean. Just type in “dot_clean ” and DO NOT hit enter. Just drag the file so that it enters the path, and THEN hit enter. It should look something like
COMPUTER:desktop Shin$ dot_clean /Users/Shin/Desktop/File
and then you’ll get a standard
COMPUTER:desktop Shin$ as a sign that it worked [I suppose. I’m still getting the -36 error, so i suspect mine is a result of something other than the ._ files.]