Author Topic: zip files with autolisp  (Read 3913 times)

0 Members and 1 Guest are viewing this topic.

Fishing4Lsp

  • Guest
zip files with autolisp
« on: January 22, 2009, 10:53:53 AM »
Hello,

I'm new to this site and in autolisp. I am trying to
write a program that will select files from various locations
then copy them to desired locations. Then after all that
I need to "zip" them.

I have winzip installed in my computer. Can you access
winzip thru autolisp or visual lisp?

I would like to be able to zip a folder and/or a list of files.
Can somebody help. A link or some coding would be appreciated?

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #1 on: January 22, 2009, 12:40:54 PM »
i actually prefer winrar ...but here is a link to a quick example i wrote a while back using 7zip.

[ http://www.theswamp.org/index.php?topic=14793.0 ]
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Fishing4Lsp

  • Guest
Re: zip files with autolisp
« Reply #2 on: January 22, 2009, 02:28:27 PM »
Thank you!. I ran the lisp. I saw it doing its thing (the dos command line)
but it did not create the zip file, or it created it in a different directory.
I'm still loking for it....But this is a good start for me. Thank you again.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #3 on: January 22, 2009, 02:51:16 PM »
Question:
Do you know Autolisp?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Fishing4Lsp

  • Guest
Re: zip files with autolisp
« Reply #4 on: January 22, 2009, 03:20:16 PM »
Yes..A little more than basic. In a scale of 1 to 10. I think I'm a 5.

deegeecees

  • Guest
Re: zip files with autolisp
« Reply #5 on: January 22, 2009, 03:23:35 PM »
I tried it as well and no go.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #6 on: January 22, 2009, 03:43:15 PM »
Yes..A little more than basic. In a scale of 1 to 10. I think I'm a 5.
good.

zip goes the current projects dir
zip-d goes to a dir of your choosing
zip-f ditto

Now if you issued the `zip' command its working on the current drawings directory. here's the problem with that one...well more like `7zip's' problem; If your in the drawing then 7z can not archive it -- it skips that drawing and any drawing anyone else is in-.  I recommend either the `zip-d' or `zip-f' functions.

With all that said; those functions are meant as a ``examples''. Their just quick hacks (that whole lisp file prolly took me 20 min to create).

We can roll a better one if you want.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #7 on: January 22, 2009, 03:43:39 PM »
I tried it as well and no go.

read the readme
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

deegeecees

  • Guest
Re: zip files with autolisp
« Reply #8 on: January 22, 2009, 03:47:13 PM »
Quote
zip goes the current projects dir
zip-d goes to a dir of your choosing
zip-f ditto

Now if you issued the `zip' command its working on the current drawings directory. here's the problem with that one...well more like `7zip's' problem; If your in the drawing then 7z can not archive it -- it skips that drawing and any drawing anyone else is in-.  I recommend either the `zip-d' or `zip-f' functions.

That cleared things up for me. Thanks se8en.

Fishing4Lsp

  • Guest
Re: zip files with autolisp
« Reply #9 on: January 22, 2009, 04:08:45 PM »
Se7en,

Yeah...That clear up things for me too. I'm okay with this for now.

Actually I was gearing more into interfacing with other applications.
I was hoping for an example like...(vlax-create-object "Winzip.Application").
I'm not even sure if its possible.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #10 on: January 22, 2009, 04:35:45 PM »
I seriously doubt it. You could attempt to use the built in windows one but your on your own with that one.

May i ask why? I mean there are plenty of great command line file archivers out there --7zip is a great example-.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Fishing4Lsp

  • Guest
Re: zip files with autolisp
« Reply #11 on: January 22, 2009, 05:29:47 PM »
Se7en,

No special reason. I thought it could be done. (Thats why I'm a "5"). The more
examples, the more I learn.

But dont get me wrong. I'm going to treasure and use this little utility. Are you
kidding. It's a great find for me...Thank you again!

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: zip files with autolisp
« Reply #12 on: January 22, 2009, 05:50:51 PM »
No problem guys; I get an idea and i just write it down as quick as i can so i can share it with theswamp.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org