Site TIPS PAGE🔎 SEARCH  Ξ INDEX  MAIN MENU  UP ONE LEVEL
 OJB's Web Site. Version 2.1. Mac Tip.You are here: tip tips mac owen2 
Tip

Up to OJB's Mac Tips List

Copy Files with Errors

If the Finder (Mac Desktop) encounters an error while copying files it "gives up". The damaged file isn't copied, even if some part of it can be read, and any other files which should have copied after the damaged one are abandoned.

Sometimes it is useful to copy a file as much as possible, even if some of it is damaged. For example, a photo might mostly copy but have a black band near the bottom, or a word processing file might be mostly intact, but have some "junk text" in the middle.

It would be great if we could just click a button on the Finder's error screen and say "Copy as much as possible", or something similar, but we don't have that option. Luckily, as is often the case on the Mac, we have the Terminal!

Start Terminal and use the "dd" command to copy the files as well as possible. If the file is damaged there's a good chance the disk (or flash drive, SD card, etc) is damaged, so copy the file onto another disk, and stop using that disk.

Here's the basic format...
dd if=/Volumes/DISKNAME/FILENAME of=/FOLDERNAME/NEWFILENAME conv=noerror,sync

Where if= specifies the input file (damaged file to read).
And of= specifies where to write the new file to.
And conv=noerror,sync specifies to continue when errors are encountered.
And DISKNAME is the name of the disk to copy from.
And FILENAME is the name of the damaged file (including suffix, like "docx").
And FOLDERNAME is the complete path to the folder to copy to.
Note: the complete path might be something like /Users/YOURNAME/Desktop.
And NEWFILENAME is the name for the new file (including suffix).

Here's an example...
dd if=/Volumes/Files/Test.jpg of=/Users/ojb/Desktop/Test2.jpg conv=noerror,sync

This reads a damaged file called "Test.jpg" which is on a disk (flash drive, SD card, etc) called "Files" and writes as much as possible to a file called "Test2.jpg" on the desktop of the user called "ojb".

Note that, in general, the suffix of the file being read and written should be the same.

Also note that there is no guarantee the file will be useful. It really depends on how much of it can be read, and if any critical parts are unreadable. If it crashes the program you try to open it with, try a different one. For example, if Word won't open one of its documents, try Pages instead.

As I said, there are no guarantees with this method, but it's better than nothing!



I usually write a blog post about once a week. The latest post can be viewed here: Deranged Rants: Many of them are totally feral, unhinged, and totally irrational. (posted 2024-11-13 at 17:55:14). I do podcasts too!. You can listen to my latest podcast, here: OJB's Podcast 2024-08-22 Stirring Up Trouble: Let's just get every view out there and fairly debate them..
 Site ©2024 by OJBOJB's BlogMicrosoft Free ZoneMade & Served on Mac 
Site Features: Blog RSS Feeds Podcasts Feedback Log07 Jun 2024. Hits: 156,519,173
Description: Mac TipKeywords: Macintosh,Computers,Fixing Problems,TipsLoad Timer: 11ms