This version drops support for Python 2.6 and 3.0.
Breaking changes
- Remove previously deprecated methods
- Replace
SquashInode
andSquashedFile
by one class per inode/file type with different attributes and methods - Remove some
SquashFsImage
attributes:fragment_buffer_size
,data_buffer_size
,block_size
,block_log
,all_buffers_size
,inode_table
,created_inode
,total_blocks
,total_files
,total_inodes
,directory_table
andinode_to_file
. Some were or are now unused, others were simply shortcuts to attributes of the superblock - Rename
SquashFsImage.sBlk
toSquashFsImage.sblk
and make it a property - Rename
SquashFsImage.image_file
toSquashFsImage._fd
- All remaining
SquashFsImage
attributes are made "private" - Root directory's path is now a single slash
- Package layout changes
- Rename command line utility from
pysquashfsimage
topysquashfs
- Change
SquashFsImage
constructor. The signature is nowSquashFsImage(fd, offset=0, closefd=True)
. Calls toSquashFsImage("/path/to/file", offset=n)
must be replaced bySquashFsImage.from_file("/path/to/file", offset=n)
- Remove
SquashFsImage.set_file()
. Use the constructor instead
New API
The most notable changes are:
- Instead of being instances of
SquashedFile
, all files are now instances of a subclass ofFile
SquashFsImage
instances can be used as context managers- Instances of
Directory
emulate a read-only mapping and have 2 new methodsriter()
andfind()
- Instances of
RegularFile
have 3 methodsiter_bytes()
,read_bytes()
andread_text()
- Iterating over an instance of
SquashFsImage
will yield all its files recursively as if usingroot.riter()
Other changes
- Add
SquashFsImage.from_bytes()
,SquashFsImage.find()
andSquashFsImage.select()
- All file types are now "scanned", not just directories, regular files and symlinks
- All struct-based classes are now ctypes-based
- Add support for LZO compression
- Add support for holes
- Reading large files is a lot faster
- Add functions for image extraction (extended attributes not supported yet)
- Add LRU cache for Python 3.2+ which can greatly speed up file reads in certain conditions
- Add
SquashFsImage.size
property - Add
find_superblocks()
- Add support for calling
dict()
on structures (instances ofstructure._Base
) - New CLI with 3 subcommands
Full Changelog: v0.8.0...v0.9.0