ZIP fie with no mac hidden files

aicul

Registered
Hello,

Does anyone know how to create a zip file without the hidden files that mac generates (for example .DS_Store)

I need this to send a clean zip of marketting material to customers that are ... unfortunately.. PC based.

Any ideas - that does not require use of a PC?
 
BlueHarvest

You can set it to prevent saving .DS_Store files or use it to clean folders or disks after the fact. I use it to prevent saving .DS_Store files to Linux web servers.
 
Another basic way is to open the folder in Terminal and do “ls -al”.

You’ll see all the . files, then you can just “rm” them.

But be aware that any folder within the archive like parent/child/subchild will show up as parent:child:subchild to your PC users.

To make it simple for myself I just upload to a Linux webserver and do the zipping there if it’s a complex file structure.
 
Thanks for your response Simbalala,

Although blueharvest seems to work, the fact that it is always active is a little painful because I don't want hidden files removed from all .zip files.

Your idea about the unix option seems better, I will work with it once I have done some further testing.

Thanks again
 
I recommend CleanArchiver, a free zip program that has an option to exclude .ds_store files (without deleting them from your system).

There's also ZipCleaner, which takes zip files created with the Finder and strips out .ds_store files and other Mac-specific data.
 
Thanks for your response Simbalala,

Although blueharvest seems to work, the fact that it is always active is a little painful because I don’t want hidden files removed from all .zip files.
BlueHarvest doesn’t remove .DS_Store unless you explicitly drag a folder or disk of some kind (memory cards included) into that prefs panel. In your case you drag the folder you wish to zip over the cleaner icon then zip it.

I got it the day it was announced because I was tired of having .DS_Store files cluttering up my hosted Linux web servers, that’s my primary use, it prevents them from being transferred and that’s why it needs to be constantly active. At the time nothing else was available but now I see from Mikuro’s post that some other options are available, ZipCleaner might be just what you need.
 
Last edited:
I was posting somewhat complex zip files containing php code. Folders within folders.

PC users complained that they opened them and found the folder structure within the archive that should look like parent/child/subchild showing up as parent:child:subchild. So instead of a hierarchical structure they were just seeing many files at the top level with long, confusing filenames.

The Mac does not use / internally it uses a :, I understood what was going on but PC users were baffled and complaining. To get around the problem I starting zipping on my Linux webservers using ssh, upload the folder then zip it there.

Mikuro, do you know of a way which would solve this problem locally?
 
umm, didn't see your comp. :)

Virtual PC?

Can you post a screenshot of your directory structure/folder names? Maybe your names are too long? I do know you're dealing with the mac has 2 directory forks and the pc only 1 issue...
 
Last edited:
umm, didn’t see your comp. :)

Virtual PC?
I’m not going to spend any money on this when I have a viable solution using the web server. I think others may benefit from any solution though.

I can’t give you a screenshot because I don’t have a PC here but you can see for yourself. Set up a dummy folder with a couple more inside, nest them. Add some files inside each folder and zip up the top level folder. Move the zip to a PC and unzip it.

Edit: There is actually a PC here but it belongs to my sister. So if I did anything at all techie with it and a meteor came crashing through the roof destroying it I’d get the blame. :confused:
 
Last edited:
That problem sounds vaguely familiar, but I've never encountered it myself. Are you sure that still happens with Tiger and Leopard? I don't think I ever used it much in Panther. Back then I used StuffIt to make zips.

Then again, I guess it's possible the people I give zips to just never complained about it. :confused: This problem happens on both Windows and Linux?
 
I’ve been on the sending side, I’ve never seen the actual result, I don’t really know the people who’ve complained.

It’s a public site with a library of routines and I’ve been told of the problem. It does make sense, we do know that Apple does use colons internally. Try putting one in a file name or just ask an app to give you the HFS path to a file, it’s like so:
Code:
Computer:Users:myname:Desktop:test.jpg

Edit: I’m on Tiger and the problems have been reported while I’ve been on Tiger. I was zipping using the contextual menu when the problem was reported, I don’t know if the result is the same when using the command line in Terminal. I just wanted to eliminate the problem for sure so I switched to the safe haven of the Linux webserver.

Anyone here running a dual boot OS X/Windows system or with a Windows PC at hand can check this for us.
 
Last edited:
There is an inexpensive program that does just what you are asking. It creates a ZIP file with no hidden mac files. It's really easy to use (drag and drop). I use it every day! It seems to stumble when there are certain characters in the filenames - but other than that, a solid application.
 
You could use the terminal's zip program to "exclude" those files. From the man page:

zip -r foo foo -x \*.o
which will include the contents of foo in foo.zip while excluding all the files that end in .o. The backslash avoids the shell filename substitution, so that the name matching is performed by zip at all directory levels.
Some other examples would be
(#exclude .DS_Store files) zip -r archive.zip myprojectdirectory -x \.DS_Store
(#exclude subversion files) zip -r archive.zip myprojectdirectory -x \.svn
(#exclude all hidden files) zip -r archive.zip myprojectdirectory -x \.*
 
Back
Top