I'm trying to delete the resource fork on files processed by an ExifTool script on Mac OS 10.6.8.
I want the original file to be replaced by the edited file (with the resource fork removed). From the documentation it seems "-overwrite_original" would be the way to do it, but I still end up with a resource fork on the output file.
ExifTool 8.77
Hi Dave,
It is interesting that this is the first time this has come up.
ExifTool preserves the resource fork by default. To delete the resource fork when writing, add -rsrc:all= to your command. The -overwrite_original option doesn't affect this behaviour.
I should probably document this. But where?
- Phil
Hi,
Never heard of it... what is Resource Fork?
Bogdan
Hi Bogdan,
On Mac OS filesystems, each file is really 2 separate files. One for the program and its data, and the other for the Mac OS resources. Windows programs contain nearly identical resource information, but it is contained in the same file as the program.
This was a neat idea because it allowed the resource fork to be easily swapped to change the look and feel of the program (ie. different skins, or different languages).
Now with OS X, the resource fork is obsolete since every application is a full directory hierarchy with any number of files (again, a really cool idea, which makes it really easy to do things like bundle exiftool into other applications), but it has been maintained for backward compatibility with older Mac OS applications.
- Phil
Thank you for detailed explanation.
Bogdan
Quote from: Phil Harvey on February 11, 2012, 07:01:43 AM
I should probably document this. But where?
I made a note about this in the RSRC Tags (https://exiftool.org/TagNames/RSRC.html) and Extra Tags (https://exiftool.org/TagNames/Extra.html) documentation.
- Phil
Quote from: Phil Harvey on February 11, 2012, 07:01:43 AM
ExifTool preserves the resource fork by default. To delete the resource fork when writing, add -rsrc:all= to your command. The -overwrite_original option doesn't affect this behaviour.
Works well. Thanks
Quote from: Phil Harvey on February 11, 2012, 07:01:43 AM
I should probably document this. But where?
Could I also suggest a note somewhere in the main documentation, maybe near the "-overwrite_original", "-overwrite_original_in_place" and "-preserve" options, as it mentions steps to preserve extended Mac directory attributes, so I naively assumed special steps needed to be taken to preserve the resource fork.
I had done a search of the main documentation for "resource fork" and only found one reference, under the "-extractEmbedded" option.
Quote from: Dave Heap on February 11, 2012, 04:51:25 PM
Could I also suggest a note somewhere in the main documentation, maybe near the "-overwrite_original", "-overwrite_original_in_place" and "-preserve" options, as it mentions steps to preserve extended Mac directory attributes, so I naively assumed special steps needed to be taken to preserve the resource fork.
I had done a search of the main documentation for "resource fork" and only found one reference, under the "-extractEmbedded" option.
I debated this for a while and went back and forth a number of times but eventually decided to add a note in the
-overwrite_original_in_place documentation as you suggest. My main concern is overburdening the application documentation with information that isn't relevant for most people, but in this case I decided that it may be worthwhile.
- Phil
Thanks. By the way, I'm the same Dave who came up with
"perldoc -T -n 'nroff -Tlatin1' exiftool | enscript -o - | pstopdf -i -o exiftool.pdf" to produce a nicely formatted PDF of each version of the documentation. I'll share it here as this was via personal email communication with you.
Quote from: Dave Heap on 17 August 2010At 7:41 AM -0400 17/8/10, Phil wrote:
Hi Dave,
On 16-Aug-10, at 5:07 PM, Dave Heap wrote:
"perldoc -T -n 'nroff -Tlatin1' exiftool | enscript -o - | pstopdf -i -o exiftool.pdf"
Nice tip, thanks. This is perfect with the -B option added to enscript.
- Phil
Agreed, but I don't mind the headers as it tells me how old the documentation is. The bolding is not particularly prominent in the resultant PDF. I think it's just because the default font (Courier10) is not very strong in bold.
Pity you can't incorporate the "-n 'nroff -Tlatin1'" bit into your default output from the 'exiftool' (implicit help) command.
Ah. Hi Dave. I didn't recognize you.
Your exiftool documentation in PDF form (https://exiftool.org/exiftool_pod.pdf) is now linked from the ExifTool home page. Thanks for that.
- Phil