Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: How to correctly extract Panther zip files System
Apple uses its own vaguely proprietary way of storing resource forks inside zip files. StuffIt doesn't yet recognize those forks (it correctly expands the files, but it doesn't add the resource fork back into the file, I guess), so don't use StuffIt for Panther zip files.

But what if zip files are assoziated with a StuffIt application? How do you get Panther to open zip files instead of Stuffit? Easy: Get Info on the file and select this application: /System -> Library -> CoreServices -> BOMArchiveHelper.

[robg adds: You can/should also check the "Change all" box so that all zip files gain this association. I haven't had any zip issues, but I did clean installs ... but maybe I've just been lucky so far.]
    •    
  • Currently 1.75 / 5
  You rated: 2 / 5 (8 votes cast)
 
[19,979 views]  

10.3: How to correctly extract Panther zip files | 9 comments | Create New Account
Click here to return to the '10.3: How to correctly extract Panther zip files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: How to correctly extract Panther zip files
Authored by: DougAdams on Oct 28, '03 11:29:57AM
This thread in the Mac OS X Hints Forum discusses other aspects of zipping files in Panther.

[ Reply to This | # ]
10.3: How to correctly extract Panther zip files
Authored by: stunami on Oct 27, '04 08:51:27AM

I was archiving video projects using BOMarchivehlper. Some can be opened and some cannot. Can anyone explain why this is so? Is there a fix? These files are reaaaaaallllly important. Any help would be much appreciated.
thanks

stuart in hong kong

---
always make new mistakes



[ Reply to This | # ]
tar bzip
Authored by: SOX on Oct 29, '03 01:14:27PM

I usually use tar -z or better yet tar -bzip to create zipped archives. Maybe some clever sole could write a clickable apple script that would take the highlighted folder in the finder and apply this action to it.

I'm not quite certian if this is HFS resource fork aware. on some minor tests it seemed that it was.



[ Reply to This | # ]
tar gzip apple script
Authored by: SOX on Oct 29, '03 01:41:40PM
here is a feeble but not quite working attempt at this

on run
	tell application "Finder"
		try
			activate
			set frontWin to folder of front window as string
			set frontWinPath to (get POSIX path of frontWin)
			tell application "Terminal"
				activate
				do script with command "(cd \"" & frontWinPath & "\" && tar -czf \"" & frontWinPath & ".tgz\"" & "\"" & frontWinPath & "\")"
			end tell
		on error error_message
			beep
			display dialog error_message buttons 
				{"OK"} default button 1
		end try
	end tell
end run
THIS DOES NOT WORK QUITE RIGHT. there are two problems. first frontWindowPath has a termnal "/" character which means I cant just concatenate ".tgz" to the end of it to create the archive name. some how I have to strip that tail "/" from the path name, but I dont know how to do this in applescript.

the second problem is that it's overkill to fire up a new terminal window to do its job: but that's only because I dont know how to just execute a unix command within apple script directly.

note that the "cd" command I execute is superfluous to the archive command. However it serves the purpose of testing to see if the directory you slected has an executable permission for you. the && comand guarentees that if the cd command fails the tar command is aborted.

if this worked correctly--and it does not-- it should allow you to select a folder in the finder and click the apple script to archive it.

[ Reply to This | # ]

unicode
Authored by: ajmas on Oct 29, '03 08:30:12PM

I should note that the file names of the files added to these zips can contain unicode characters. OpenUp, Stuffit and BOMArchiver can handle files contained, with any character. Though, take them over to a PC, where WinZip is king and you are screwed. The accents show up wrong and none of the non-latin characters show up properly either.

I have already contacted the developers of WinZip and it doesn't even seem to be in their roadplan - sucks. Modern MS-Windows supports unicode, so I am surprised the developers of WinZip don't address this. Maybe now Apple supports unicode characters in Zip files, we may see some changes.



[ Reply to This | # ]
A script to repair StuffIt-expanded Panther zip files
Authored by: fy on Oct 31, '03 10:03:11AM
named "ReSeZoP" is now here.

property dq : (ASCII character 34)
property thePath : ""

display dialog "First, drop Panther's native zip archives on StuffIt Expander, and drop the generated folder on me."

on open drop_items
	repeat with theObj in drop_items
		tell application "Finder"
			set thePath to theObj as Unicode text
			if (folder thePath exists) and (folder (thePath & "__MACOSX") exists) then
				repeat with i in (list folder theObj)
					if i as Unicode text is not ".DS_Store" and i as Unicode text is not "__MACOSX" then
						my dirConv(alias (thePath & (i as Unicode text)), thePath)
						move (alias (thePath & (i as Unicode text))) to container of theObj with replacing
					end if
				end repeat
				do shell script "rm -r " & dq & (POSIX path of file thePath) & dq
			end if
		end tell
	end repeat
end open

on dirConv(theObj, thePath) --process recursively
	tell application "Finder"
		if (folder (theObj as Unicode text) exists) then --in case of a folder
			repeat with i in (list folder (theObj as Unicode text))
				my dirConv(alias ((theObj as Unicode text) & i), thePath)
			end repeat
		else if (name of (alias (theObj as Unicode text)) ends with ".app") then --in case of a package
			repeat with i in (list folder (theObj as Unicode text))
				my dirConv(alias ((theObj as Unicode text) & ":" & i), thePath)
			end repeat
		else if name of (alias (theObj as Unicode text)) is not ".DS_Store" then --in case of a file other than ".DS_Store"
			set theFile to alias (theObj as Unicode text)
			set oldDelim to text item delimiters of AppleScript
			set text item delimiters of AppleScript to thePath
			set theList to every text item of (container of (alias (theObj as Unicode text)) as Unicode text)
			set text item delimiters of AppleScript to (thePath & "__MACOSX:")
			set theStr to theList as Unicode text
			set text item delimiters of AppleScript to oldDelim
			if alias (theStr & "._" & name of (alias (theObj as Unicode text))) exists then
				set subFile to alias (theStr & "._" & name of (alias (theObj as Unicode text)))
				set theCom to "perl -e 'open(IN," & dq & "<" & (POSIX path of file (subFile as Unicode text)) & dq & ");"
				set theCom to theCom & "for(1..50){$c = getc(IN);if($c eq " & dq & dq & "){close(IN);exit;}}"
				set theCom to theCom & "$s=" & dq & dq & ";for(1..8){$c = getc(IN);if($c eq " & dq & dq & "){close(IN);exit;}$s.=$c;}"
				set theCom to theCom & "for(1..24){$c = getc(IN);if($c eq " & dq & dq & "){close(IN);exit;}} if($s eq " & dq & dq & "){close(IN);exit;}"
				set theCom to theCom & "open(OUT," & dq & ">" & (POSIX path of file (theObj as Unicode text) & "/..namedfork/rsrc") & dq & ");"
				set theCom to theCom & "while(1){$c = getc(IN);if($c eq " & dq & dq & "){last;} print OUT $c;} close(OUT); close(IN);print $s;'"
				do shell script theCom
				set ftct to result
				if ftct is not "" then
					set file type of theObj to (ASCII character (ASCII number (character 1 of ftct))) & (ASCII character (ASCII number (character 2 of ftct))) & (ASCII character (ASCII number (character 3 of ftct))) & (ASCII character (ASCII number (character 4 of ftct)))
					set creator type of theObj to (ASCII character (ASCII number (character 5 of ftct))) & (ASCII character (ASCII number (character 6 of ftct))) & (ASCII character (ASCII number (character 7 of ftct))) & (ASCII character (ASCII number (character 8 of ftct)))
				end if
			end if
		end if
	end tell
end dirConv


[ Reply to This | # ]
10.3: How to correctly extract Panther zip files
Authored by: JJ on Nov 17, '03 08:52:52PM

On my clean install of Panther, the Finder opens its own zip archives fine, and "Open with..." shows BOMArchiveHelper as the default app to do so.

However, if I put such a created-by-Panther zip-file on a webserver and then download it with Safari on the same system that created it, strange things happen:

- if the Safari pref "open safe downloads" is off, then the archive is downloaded but not expanded (as expected). Double-clicking it then expands it correctly.

- if the Safari pref "open safe downloads" is on, the archive gets expanded with the seperate __MACOSX folder, which is bad news for resource-fork dependant files, and very confusing

In the second scenario, Stuffit Expander is not lauched, so the Finder itself is corrupting an archive it just made itself...



[ Reply to This | # ]
StuffIt Expander 8.0.2
Authored by: fy on Dec 20, '03 12:02:58AM
Doesn't StuffIt Expander 8.0.2, included in StuffIt Standard 8.0.2, combines split forks when expanding Panther zip files? (I think it does, but I couldn't found comments saying it here and in forums.)

[ Reply to This | # ]
StuffIt Expander 8.0.2
Authored by: VirtualWolf on Jun 03, '04 02:55:19AM

Aye, it does. I just created a zip archive of one of the Classic System fonts (Charcoal in this case), unzipped it with Stuffit Expander 8.0.2, and it unzipped fine.



[ Reply to This | # ]