'x:gz' - It creates an archive for writing with gzip compression.'x'/'x:' - It creates archive without compression.'r:xz' - It opens the archive for reading with lzma compression.'r:bz2' - It opens the archive for reading with bzip2 compression.'r:gz' - It opens the archive for reading with gzip compression.'r:' - It opens the archive for reading without compression.'r'/'r:*' - It opens the archive for reading with transparent compression.Below is a list of modes with which tar files can be opened. File open modes are generally of the form 'mode'. It returns an instance of type TarFile which has a list of methods that can be used to work with members of the tar file. Open(name=None,mode='r') - This method takes as input tar file name and mode of reading tar file. We have included method definitions in all of our examples. The tarfile provides us with useful methods for this.īelow, we have listed signatures of important methods that can be referred to properly using various methods.
0 Comments
Leave a Reply. |