how to create .tar file on windows OS?
15,477
Solution 1
I'd get some form of tool (like 7zip) to do this - Google has alternatives and demos. Otherwise you'll need to do something like scp it to a linux server and tar it up via command line.
Solution 2
http://unxutils.sourceforge.net/ has ported the majority of Unix tools to the Win32 API, including tar
.
Solution 3
If Python is installed, then you can use the tarfile
module:
import tarfile
with tarfile.open('myFolder.tar', 'w') as tar:
tar.add('myFolder/')
or if you want a compressed file, then do:
import tarfile
with tarfile.open('myFolder.tar.gz', 'w:gz') as tar:
tar.add('myFolder/')
Links
- https://www.scribd.com/doc/521235/Python-Tutorial-tarfile-module
- https://docs.python.org/2/library/tarfile.html#examples
![Girdhar Singh Rathore](https://i.stack.imgur.com/f2GIh.jpg?s=256&g=1)
Author by
Girdhar Singh Rathore
I am a tech geek, I love to learn new technologies and solve programming problems.
Updated on June 14, 2022Comments
-
Girdhar Singh Rathore about 2 years
I am using
window OS
. I have afolder
named asmyFolder
which contains manyfiles
, I need to convert thatmyFolder
tomyFolder.tar
file. Anyone please suggest how to do it?