You are copying a folder from your Mac to an external drive — perhaps transferring files to a USB drive to share with a Windows user — when the operation suddenly halts and Finder throws up the message: "The Finder can't complete the operation because some data in '[filename]' can't be read or written. (Error Code -36)."
Mac Error Code 36 is a file copy error with a surprisingly specific cause: macOS is trying to copy a hidden metadata file called a "dot-underscore file" (e.g., ._filename) to a destination drive that uses a file system (like FAT32 or exFAT) that doesn't support these macOS-specific metadata files.
The great news: Error 36 has a very clean, elegant fix built right into macOS Terminal. Let's walk through it.
Why Does Error 36 Happen?
macOS generates invisible companion files for most files and folders. These hidden files start with ._ (dot-underscore) and store macOS-specific metadata like resource fork data, extended attributes, and Finder information (like color labels). On Mac-formatted drives, these files are tucked away invisibly in a special stream.
When you copy a file to an external drive formatted as FAT32 or older Windows-compatible file systems, macOS tries to create these companion files as separate visible files on the destination drive. If the destination doesn't support the required file attributes, or if a previous partial copy left a corrupted companion file, the copy fails with Error 36.
Step 1: Use dot_clean via Terminal (The Definitive Fix)
macOS includes a built-in command-line tool called dot_clean specifically designed to merge these orphaned dot-underscore metadata files back into the parent files, then clean up any leftover ones. Running this tool on the source folder before copying eliminates the files that are causing Error 36.
- Open Terminal from Launchpad > Other.
- Type
dot_clean(with a space at the end — do not press Return yet). - Open Finder and navigate to the folder you are trying to copy (the source folder on your Mac, not the destination drive).
- Drag the source folder from Finder directly into the Terminal window. The folder's path will be automatically inserted.
- Your command should now look like:
dot_clean /Users/YourName/Documents/YourFolder - Press Return.
- Terminal will run silently for a moment (there is no progress indicator). When it returns to the command prompt, it is done.
Now try copying the folder to the external drive again via Finder. In the vast majority of cases, the copy will complete successfully without Error 36.
Step 2: Run dot_clean on the Destination Drive
If the error still appears, the issue may be with orphaned dot-underscore files already on the destination external drive from a previous failed copy. Run dot_clean on the destination folder as well.
- In Terminal, type
dot_cleanagain. - This time, drag the destination folder on the external drive into the Terminal window.
- Press Return and wait for it to complete.
- Retry the copy operation.
Step 3: Use Terminal's cp Command Instead of Finder
If Finder keeps failing, you can use Terminal to perform the copy directly, which handles the metadata files differently and often bypasses the error entirely.
- In Terminal, type:
cp -R(with a space at the end) - Drag the source folder from Finder into Terminal (path auto-fills).
- Type a space, then drag the destination folder (on the external drive) into Terminal.
- Press Return. Terminal will copy the folder using a method that handles macOS metadata more gracefully.
Step 4: Reformat the External Drive to ExFAT
If you need to regularly transfer files between your Mac and a Windows PC, using the FAT32 format will cause this error repeatedly. ExFAT is the modern replacement — it supports large files, is compatible with both Mac and Windows natively, and handles macOS metadata files more gracefully.
Use Disk Utility (Launchpad > Disk Utility) to erase and reformat the external drive to ExFAT. Remember to back up any existing data on the drive first, as formatting erases everything.
Conclusion
Mac Error Code 36 is a neat, fixable problem once you understand that it's caused by macOS's hidden metadata companion files conflicting with non-Mac file systems. The dot_clean Terminal command is your primary weapon — it is built into macOS specifically for this purpose and resolves the error cleanly in most cases.


