# Create zip file on Mac

**URL:** <https://forum.xojo.com/t/create-zip-file-on-mac/9469>\
**Category:** macOS\
**Created:** [July 11, 2013, 8:20pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469 "2013-07-11T20:20:22Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [April 27, 2016, 2:54pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/21 "2016-04-27T14:54:41Z")

</div>

google for “os x man page” and then the topic  
ie/ os x man page gzip

or open terminal & use man directly

---

<div class="post-metadata">

**Author:** ![Martin\_T](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@Martin\_T](https://forum.xojo.com/u/Martin_T)\
**Post date:** [April 27, 2016, 2:55pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/22 "2016-04-27T14:55:21Z")

</div>

> [@262560:@Peter Job](#):
>
> There is surely a command line option. What about -j ? Does OS X have Unix man pages - if so look there?

-j stores all Files into the zip, but at the same level. “Other Folder” isn’t included.

---

<div class="post-metadata">

**Author:** ![Peter\_Job](https://forum.xojo.com/letter_avatar_proxy/v4/letter/p/bbce88/32.png) [@Peter\_Job](https://forum.xojo.com/u/Peter_Job)\
**Post date:** [April 27, 2016, 3:23pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/23 "2016-04-27T15:23:44Z")

</div>

Well maybe I misunderstand.

The only Mac I can use is an emulated Snow Leopard and it works as I would expect via terminal:

cd myfolder  
zip -r myfolder.zip \*

I am sure you could get it to do the right thing by specifying the path to myfolder - there must be a way.

( If not I’ll just stfu and go play on Windows 😉 )

---

<div class="post-metadata">

**Author:** ![Martin\_T](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@Martin\_T](https://forum.xojo.com/u/Martin_T)\
**Post date:** [April 27, 2016, 3:48pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/24 "2016-04-27T15:48:04Z")

</div>

My Source:

SaveZip(f As FolderItem)

[code]Dim mf As FolderItem

mf = GetFolderItem("").Child(“MyFolder”)  
mf.CreateAsFolder

Dim t As TextOutputStream  
Dim abc As FolderItem

abc = mf.Child(“ABC.txt”)  
t = TextOutputStream.Create(abc)  
t.Write(“bla bla bla”)  
t.Close

Dim of As FolderItem

of = mf.Child(“Other Folder”)  
of.CreateAsFolder

Dim nw As FolderItem

nw = of.Child(“new.txt”)  
t = TextOutputStream.Create(nw)  
t.Write(“bliblablubb”)  
t.Close

Dim sh As New Shell

// OS X only  
sh.Execute("zip -r " + f.ShellPath + " " + mf.ShellPath + “\*”  
[/code]

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [April 27, 2016, 6:10pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/25 "2016-04-27T18:10:56Z")

</div>

Beside zip command line tool, you can also check MBS Compression Plugin for some cool zip file classes.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:44pm UTC](https://forum.xojo.com/t/create-zip-file-on-mac/9469/26 "2020-10-29T16:44:49Z")

</div>



[Previous page](https://forum.xojo.com/t/create-zip-file-on-mac/9469.md?page=1)
