Open a file within an ISO in python.

David wizzardx at gmail.com
Sun May 4 06:11:32 EDT 2008


On Sun, May 4, 2008 at 12:01 PM,  <danikar at gmail.com> wrote:
> Is there a way to open a file that is inside of an ISO in python?
>
>  Say I have an ISO file, danikars.iso and on the iso there is a file
>  called information.txt
>
>  I want to be able to do something like this.
>
>  [code]
>  iso_h = openiso("danikars.iso")
>  file_h = iso_h.extract("information.txt")
>  contents = file_h.read()
>  [/code]
>
>  Is there anything that will give me that functionality? Or close?
>

Under Linux you can mount iso files as loopback devices.

eg:

mkdir mnt
sudo mount -o loop file.iso ./mnt

Then the ./mnt directory will 'contain' the contents of the iso



More information about the Python-list mailing list