zip nesting empty folders


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers zip nesting empty folders
# 1  
Old 09-29-2006
zip nesting empty folders

I'm using the following command to zip a project file, but when it finishes, the resulting zip file contains all the directories above the file I wanted zipped, myapp.app, each one empty until you get to the actual app.

zip -r myapp.app.zip
/Users/je/Documents/Programming/Projects/myapp/build/Release/myapp.app

I've tried adding the j option, but since this is a Mac OS X .app, it itself has subdirectories that are needed to be retained. Is there some option which wont force me to cd to the correct directory to make it current before performing the zip -- or am I just using this wrong?

Thanks

All My Best,
Jeffrey
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Gunzip,grep and zip across folders in a subdirectory

I have a simple function that greps within a folder into files that are already gunzipped. This was already written for me so from my understanding fn=$1 specifies that it will look into any file in that folder that is gunzipped and the rest of the script greps the data its looking for and puts it... (3 Replies)
Discussion started by: red56
3 Replies

2. UNIX for Dummies Questions & Answers

How to delete some empty folders?

I have an amount of folders and I want to delete only the empty ones. But I have more than 200 empty folders, so I would preffer do not delete one by one... I know it is possible, but I don't know how. I've tried with the size, using 'du' command, and saving the result in a file. After that, I made... (3 Replies)
Discussion started by: saitsug
3 Replies

3. Shell Programming and Scripting

How to auto zip all folders?

Hi, How do I write a script that will automatically find and zip any folder to the same name in a directory and affected recursively?. The zip file should be place in the same directory where the source folder is. Help is appreciated. Thanks in advance. ex: Orange Crayon Blue Crayon... (5 Replies)
Discussion started by: Frozen77
5 Replies

4. Windows & DOS: Issues & Discussions

Empty folders with SFU

Hi all, i am currently setting my windows XP environment to use with Services for Unix (NFS Client) to mount my unix file system as a network drive. However, though i could mount the unix file directory successful, but the folder is empty (which is not). Why is this so? i have imported my unix... (6 Replies)
Discussion started by: lchunleo
6 Replies

5. Shell Programming and Scripting

Copy Folders and ZIP IT

HI All I have one master folder : ABCXYZ I have sub folder in there : AB XY AZ AC PR AL Now i want to copy AB , PR ,AL in to one new folder and zip it with time stamp. like Pre_02192013_12_32.zip Zip folder should be in master folder. (2 Replies)
Discussion started by: pareshkp
2 Replies

6. Shell Programming and Scripting

Deleting empty folders

Hey, I need help with writing a shell script that deletes empty folders..anyone? :) Thank you! (5 Replies)
Discussion started by: putukas
5 Replies

7. UNIX for Dummies Questions & Answers

Removing empty folders

Hello, I have a folder that contains all my music. Recently, I started using a different media player, and I let it manage my music folder. It has sorted all my music neatly in folders by artist and album. However, all the old folders that the songs used to be in are still there, yet they are... (2 Replies)
Discussion started by: emveedee
2 Replies

8. Shell Programming and Scripting

Find empty folders

In current folder, there are many subfolders, subfolder's subfolders... under it. How can I find out the empty folders with no files in it. I only need the top folder list. For example, I have folders like below: a/b/c a/b/x/x.txt a/s a/s/y I need get the folder a/s, but not... (6 Replies)
Discussion started by: rdcwayx
6 Replies

9. UNIX for Dummies Questions & Answers

Zip a folder including its sub-folders.

Hi, I have a folder that contains a few sub-folders. I would like to zip that folder and KEEP the subfolders. What it does at the moment is taking all the files within the subfolders and zipping them into one big file (zip -r ...). Does anyone know the UNIX command to keep the subfolders in the... (3 Replies)
Discussion started by: gdog
3 Replies

10. UNIX for Dummies Questions & Answers

how to find empty folders without using -empty

hi all: my solaris FIND does not support find myFolder -type d -empty how can i find the empty folders? thanks! (7 Replies)
Discussion started by: lasse
7 Replies
Login or Register to Ask a Question
ZIP_ADD(3)						     Library Functions Manual							ZIP_ADD(3)

NAME
zip_add , - .Nm zip_replace add file to zip archive or replace file in zip archive LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> zip_int64_t zip_add(struct zip *archive, const char *name); "struct zip_source *source" int zip_replace(struct zip *archive, zip_uint64_t index); "struct zip_source *source" DESCRIPTION
The function zip_add adds a file to a zip archive, while zip_replace replaces an existing file in a zip archive. The argument archive specifies the zip archive to which the file should be added. name is the file's name in the zip archive (for zip_add ), while index speci- fies which file should be replaced (for zip_replace ). The data is obtained from the source argument. See the zip_source_* functions cited in SEE ALSO. RETURN VALUES
Upon successful completion, zip_add returns the index of the new file in the archive, and zip_replace returns 0. Otherwise, -1 is returned and the error code in archive is set to indicate the error. EXAMPLES
struct zip_source *s; if ((s=zip_source_buffer(archive, buffer, len)) == NULL || zip_add(archive, name, s) 0) { zip_source_free(s); printf("error adding file: %s0, zip_strerror(archive)); } ERRORS
zip_add and zip_replace fail if: [ZIP_ER_EXISTS] There is already a file called name in the archive. (Only applies to zip_add ). [ZIP_ER_INVAL] source or name are NULL, or index is invalid. [ZIP_ER_MEMORY] Required memory could not be allocated. SEE ALSO
libzip(3), zip_source_file(3), zip_source_filep(3), zip_source_function(3), zip_source_zip(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH March 10, 2009 ZIP_ADD(3)