I want to create a .rar
file by passing file paths of the files to be archived.
I have tried the rarfile
package. But it doesn't have a 'w'
option to write to the rarfile handler.
Is there any other way?
I want to create a .rar
file by passing file paths of the files to be archived.
I have tried the rarfile
package. But it doesn't have a 'w'
option to write to the rarfile handler.
Is there any other way?
How about lib-rar-python
?
It's a Python wrapper around the command line rar
program, but it may be limited to Linux only.
On other platforms you could just call the command line rar program directly using Python's subprocess
library.
rar
command line program, and make sure to pass it's path it as the rarbin
argument when creating an Archive
object. This could even work on Windows, as long as you manage to install a rar
executable which accepts the same set of parameters. See the code for details. –
Garbe os.system('rar a <archive_file_path> <file_path_to_be_added_to_archive>')
Can also be used to achieve this.
How about lib-rar-python
?
It's a Python wrapper around the command line rar
program, but it may be limited to Linux only.
On other platforms you could just call the command line rar program directly using Python's subprocess
library.
rar
command line program, and make sure to pass it's path it as the rarbin
argument when creating an Archive
object. This could even work on Windows, as long as you manage to install a rar
executable which accepts the same set of parameters. See the code for details. –
Garbe © 2022 - 2024 — McMap. All rights reserved.