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 7415981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:24:09+00:00 2026-05-29T07:24:09+00:00

Aloha stackoverflow denizens! I am writing an application that will compress a folder and

  • 0

Aloha stackoverflow denizens!

I am writing an application that will compress a folder and its contents to an archive (potentially a tarfile, but I am open to other formats). This, I know how to do using native python modules. The part that I am not sure how to do would be to break up the tarfile to either x-number of different file objects, or a series that have a max size of y.

I have googled about and RTFM’d, but have not noticed some native method that would provide a similar function.

I have considered something along the lines of:

def fileshrink(filename, numberoflines):
    f=open(filename)
    g=0
    while f.hasnext():
        newfile="newfile"+g+".txt
        g.open(newfile)
        for line in range(numberoflines):
            g.write(line)

but I do not think it will work on things like *.docs, *.exes, or other non text filetypes.
Can you offer me some insight into how to best procede?

  • 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-29T07:24:10+00:00Added an answer on May 29, 2026 at 7:24 am

    file.read() will allow you to read an arbitrary number of bytes from the file.

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

Sidebar

Related Questions

Aloha I'm referencing an external webservice in my .NET 2.0 application. Adding a service
Aloha, I have a 8MB XML file that I wish to deserialize. I'm using
I've been googling and querying stackoverflow quite a bit but I haven't found this
I have code that works in Chrome and Firefox, but not in IE8. <a
Aloha, I need to match page.aspx?cmd=Show&id= but not match http://random address/page.aspx?cmd=Show&id= Right now I'm
Aloha everyone, I apologize in advance for the many questions, but I've been asked
I have searched Google and Stackoverflow for this question, but I still don't understand
Aloha I have a VS2008 solution to which I want to add a webservice
Aloha I have a method with (pseudo) signature: public static T Parse<T>(string datadictionary) where
Aloha I received a nice wsdl with xs: documentation tags like: <xs:complexType name=Supplier> <xs:annotation>

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.