Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104025

Re: creating zipfile with symlinks

From crankypuss <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: creating zipfile with symlinks
Date 2016-03-04 04:03 -0700
Organization see-sig
Message-ID <nbbprf$heq$1@dont-email.me> (permalink)
References <mailman.158.1457030287.20602.python-list@python.org>

Show all headers | View raw


Larry Martell wrote:

> I have a script that creates zip files of dirs containing symlinks. I
> was surprised to find that the zipfiles have zipped the targets of the
> links as opposed to the links themselves, which is what I wanted and
> expected. Googling I found this:
> 
> https://doeidoei.wordpress.com/2010/11/23/compressing-files-with-python-symlink-trouble/
> 
> Which I don't love as a solution. Anyone know a cleaner way to get
> zipfile to zip the links?

I don't even know what "zipfile" is, is that a Windows command?  On 
linux the tar command's --dereference option causes the behavior you 
describe, which is not its default.  Not sure if this is applicable to 
your situation, or not:

http://www.gnu.org/software/tar/manual/html_node/dereference.html

-- 
http://totally-portable-software.blogspot.com
  [Mon Feb 29: "Addresses - What Good Are They?"]

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

creating zipfile with symlinks Larry Martell <larry.martell@gmail.com> - 2016-03-03 13:37 -0500
  Re: creating zipfile with symlinks crankypuss <invalid@invalid.invalid> - 2016-03-04 04:03 -0700
    Re: creating zipfile with symlinks Tim Golden <mail@timgolden.me.uk> - 2016-03-04 11:12 +0000
    Re: creating zipfile with symlinks Grant Edwards <invalid@invalid.invalid> - 2016-03-04 15:56 +0000
      Re: creating zipfile with symlinks crankypuss <invalid@invalid.invalid> - 2016-03-04 11:50 -0700
        Re: creating zipfile with symlinks Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-04 13:31 -0700
          Re: creating zipfile with symlinks Wildman <best_lay@yahoo.com> - 2016-03-04 20:12 -0600

csiph-web