Why the same zip file doesn't work in MacOS? - macos

This is quite strange for me. I have an APP file (.app) which works on my MacOS. I want to upload it into the AWS S3 so I zip it as .app file is considered as a folder. When I download the zip file and unzip it, the app doesn't work anymore.
I even tried zipping it in terminal
zip -yr myapp.zip myapp.app
And when I download it, I also tried unzipping it in terminal
unzip myapp.zip -d myapp-folder
But that was also doesn't work. I checked the app size and they are identical. Any idea why it happens? and how can I fix it?

zip/unzip don't preserve file attributes (including extended attributes). To fix this, use ditto tool instead of zip/unzip.
The same rule for just copying files: use ditto instead of cp

Related

Downloads folder from JupyterLab

I'd like to download a folder of pickle files from Jupyterlab (running on a google cloud instance) and I'm unable to find a way to do so. Apparently, downloading individual files is permitted but I have about 500 individuals pickle files in my folder to download and so would take while to do that manually.
As you can see in the menu below (when right click on the folder I want to download) I manage to install a "download folder as archive" extension but for some reasons the resulting zip format is unreadable locally.
I'm sure there must be a way of downloading folder easily from Jupyterlab and any help would be highly appreciated.
Thank you
I finally find a solution by zipping the folder using the following command:
zip -r example.zip original_folder
And it worked.
On you notebook try this
!zip -r example.zip original_folder
by adding ! you tell the notebook that you wanna execute external commands
You can also open a bash terminal, pack all desired files into an archive
tar -czf ARCHIVE_NAME.tar.gz FOLDER1 FOLDER2
and then download them. It might be necessary to move the archive into your virtual home folder in order to see it in the file browser on the left side though.

How to unpack xx.tar.z files types?

I have installed a software that unpacks .zip and .tar files. However
I was wondering how do you unpack this kind of files myxxx.tar.z?
I have Tugzip installed but cannot open such .tar.z file format.
Also how do you zip such files?
The most famous app to do this kinda stuff is the Winrar. Did you tried with it? You can try the 7zip too.
If your working on linux, you can do,
To decompress:
tar -zxvf myxxx.tar.z
To compress:
tar -czvf your-file.tar.z your-files

wget or curl to download .app file that has been zipped from github

app file that I have zipped up and pushed to a github project of mine.
Now i want to write a bash script to download this zipped file, however I can't seem wget to work.
I am doing wget
https://github.com/MyProject/myRepo/blob/master/appBuild/myApp.zip?raw=true -O /Users/myName/Desktop/myApp.zip
but I get some corrupted file
On my github repo, I have been using wget to download the main archive.
Try this for you:
wget https://github.com/MyProject/myRepo/blob/master/appBuild/myApp.zip -O /Users/myName/Desktop/myApp.zip
I simply removed the "?raw=true" from the link. I haven't used that flag before.
If you can provide me the actual link, I'd be happy to test it for you.

Xcode5 post-archive script for Sparkle package no longer works

Xcode 5 seems to have changed the way it stores the build application package (xxx.app) such that ditto no longer works. In the ../BuildProductsPath/Release/ directory, the app is actually a symlink to .../InstallationBuildProductsLocation/Applications/...
MyApp.app -> ~/Library/Developer/Xcode/DerivedData/MyApp-emwilkqhlayanxahjpexlpbbkato/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp
This breaks the ditto command I was using to create a zip file of the application to put on my Sparkle update server.
Anyone have an updated script for building the Sparkle XML and ZIP files? Or know what environment variable I need to use to locate my actual binary after the Archive phase?
Here's the relevant lines from the post-archive script:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
cd "$BUILT_PRODUCTS_DIR"
ditto -ck --keepParent "$PROJECT_NAME.app" "$ARCHIVE_FILENAME"
That's from the sample script on the Sparkle website.
Turns out that in Xcode5 you need to pull the app package from the archive directory, not the Built Products directory. This works:
ARCHIVE_FILENAME="$HOME/Desktop/$PROJECT_NAME-$VERSION_STRING.zip"
ditto -ck --keepParent "${ARCHIVE_PRODUCTS_PATH}/Applications/${PROJECT_NAME}.app" "$ARCHIVE_FILENAME"

How to unzip files in a Heroku Buildpack

I'm writing a custom Heroku buildpack (heroku-buildpack-fantom) for Fantom, and as part of the compile script I've downloaded a .zip file (from a language vendor), but how do I unzip it?
unzip is not a recognised command.
gunzip exists but I can't use it to unzip .zip files.
What am I missing?
Even though (by default) Linux does not come pre-installed with unzip, the Heroku dyno does have a jar command. So the following works okay:
> jar xf wotever.zip
Be sure to run the 'file' command on it. I got a .zip file from SourceForge that was actually bzip2 encoded and Heroku has both the bunzip2 decoder and the -j (--bzip2) option on tar to handle it.

Resources