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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:59:55+00:00 2026-05-31T00:59:55+00:00

It feels like this is a colossally stupid question, but the documentation for rar

  • 0

It feels like this is a colossally stupid question, but the documentation for rar as a whole is pretty sketchy, and using python to rar pulls an insane number of hits, none of them even seem to be attempting what I’m trying to do (which I find somewhat odd).

I have a directory with a bunch of files:
FILE_1.ext
FILE_2.ext
FILE_3.ext
…
FILE_N.ext

The names aren’t necessarily uniform, neither are the extensions.
I’m looking for a python script to:
for all files in directory that don’t start with .
rar a -m0 -R -v1g FILE_NAME.rar “FILE_NAME” #Note: FILE_NAME.rar doesn’t have the “.ext”

The “rar a -m0 -R -v1g FILE_NAME.rar “FILE_NAME”” part is what I use when I’m sending a shell command, for one file, and I have to enter the FILE_NAME myself, etc. Hasn’t been a problem, but now I’m dealing with a lot of large files, and it’s too much to enter them all in one-by-one, but I need to have each file be it’s own volume.

  • 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-31T00:59:57+00:00Added an answer on May 31, 2026 at 12:59 am

    How about:

        import os
        for file_n in os.listdir(DIRECTORY_NAME):
             if not file_n.startswith('.') and not file_n.endswith('.rar'):
                  os.system('rar a -m0 -R -v1g %s.rar "%s"' %(os.path.splitext(file_n)[0], file_n))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This feels like a really basic question, but I can't figure it out anyway..
This feels like it should be pretty simple, but not much seems to be
OK, this feels like an idiot question, but I'm stuck - I don't know
I feel like this is a stupid question, but I can't think of a
It feels like this question has been asked before, but no questions seem to
This feels like the kind of code that only fails in-situ, but I will
It feels like there must be some semi-simple solution to this, but I just
I feel like this is easy but I am missing something... Using jQuery, I
This feels like a too easy question to be found with google, I think/hope
Maybe I'm stupid but Rails provides this nifty syntax for generating URL's like so:

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.