Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:38:19+00:00 2026-05-24T09:38:19+00:00

I wrote a script that collects all our log files to one tar file.

  • 0

I wrote a script that collects all our log files to one tar file. The problem is that it doesn’t contain soft link’s data. I tried to use the dereference flag but it is not recognized for python 2.4.3.

I can’t use the command line since there’s a length limit and I want to support many log files.

user ~/Desktop]$python
Python 2.4.3 (#1, Jun 11 2009, 14:09:37)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2

>>> import tarfile
>>> tarfile.TarFile('test.tar.gz', mode='w', dereference=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: __init__() got an unexpected keyword argument 'dereference'
>>>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:38:20+00:00Added an answer on May 24, 2026 at 9:38 am

    According to the Python 2.4 docs dereference = True is supported. It appears to have been supported since tarfile was added in Python 2.3.

    Unless you’re on a non-Posix system (Windows) you must be doing it wrong. Post your code and the error you get with dereference = True so we can tell you what that is.

    Also, by soft links I assume you mean symbolic links? Because that’s what dereference = True allows to work.

    Edit: I just looked at the code for tarfile on Python 2.4. It does not support the dereference parameter to the constructor, but it does seem to have the needed code to actually dereference (Checked against the source for Python 2.6). So,

    import tarfile
    tf = tarfile.TarFile('test.tar.gz', mode='w')
    tf.dereference = True
    

    should work. Please, update with your results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I wrote a script that generates a xml file based on user input.
I wrote init.d script that suppose to run java CLI proccess. The problem is
I wrote Python script that processes big number of large text files and may
I wrote this simple script that reads a text file and then adds the
I wrote a script that reads each file in a directory, does something and
I wrote a script that downloads files from an Http server, but the results
I recently wrote a script that does a sed command, to replace all the
I wrote a script that uses xcodebuild to generate an AdHoc build of an
I wrote a Python script that does some task to generate, and then keep
This is a crude korn shell script that someone else wrote. I don't know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.