C-Command Software Forum

Exclude specific files when creating disk image (e.g. .DS_Store)

So I’m creating a bunch of dmgs from folders and I would love to see a feature implemented that excludes files matching either a specific or semi-specific name, for example:

// Blacklist
.DS_Store
*.png
sushi trip *.mov
Foo, Part ? of ???.*

My main issue is with .DS_Store. I keep having to sanitize (

find /folder/to/be/imaged -name ".DS_Store" -type f -print -delete

) my folders before dropping them into DropDMG. I just don’t want those buggers in my dmgs. Icon_razz.gif

What would also be handy would be to have the choice to specify where you want the blacklist rules to apply. For example, only apply blacklist in dmg_root/Documents/Adobe/, or, apply blacklist everywhere except /dmg_root/Backups/T-Shirts/.

I understand about not liking .DS_Store files, but could you explain what you’re trying to do in the other cases? What is the context for wanting to image a folder except for its .png files? Are you making repeated backups of the same folders?

Well, in my case, I only need it for keeping .DS_Store out of the way. I thought if there was a blacklist, things like keeping appledouble files out (by using something like ^._*) would work too. I just gave .png and files like that as examples, in case someone would need them blacklisted for some reason.

Do you want to keep the .DS_Store files in your source folder, or do you only want to get rid of them on the .dmg itself?

Rather than a blacklist, would it be more useful to be able to have DropDMG run a script before creating the disk image, and then you could run your “find” command there?

Yeah, I guess that could work. The only thing is I’d keep having to change the path in my script. But hey, that’s better than manually doing it.

DropDMG would pass the path into the script.