If there is a Linux.img file, I can see the actual size of the image. if
there is a Linux.img.xz file, how can I tell the size of it when xz = Popen(["/usr/bin/xz", "-cdk", "Linux.img.xz"], stdout=PIPE)
is executed. The decompressed file is written to the standard output, there will not be an actual file on the disk that I can check with command fdisk -l <FILE>
.
Why I am doing this is because the image is about to be written to a SD card. Right before that I want to check if the image is larger than the SD card. Using the stdin
and stdout
can avoid disk writing which can speed up the process a little bit.