python: edit ISO file directly

前端 未结 4 1618
抹茶落季
抹茶落季 2021-01-03 10:53
  1. Is it possible to take an ISO file and edit a file in it directly, i.e. not by unpacking it, changing the file, and repacking it?
  2. It is possible to do 1. from
4条回答
  •  感情败类
    2021-01-03 11:45

    You can use for listing and extracting, I tested the first.

    https://github.com/barneygale/iso9660/blob/master/iso9660.py

    import iso9660
    cd = iso9660.ISO9660("/Users/murat/Downloads/VisualStudio6Enterprise.ISO")
    for path in cd.tree():
        print path
    

    https://github.com/barneygale/isoparser

    import isoparser
    iso = isoparser.parse("http://www.microsoft.com/linux.iso")
    
    print iso.record("boot", "grub").children
    print iso.record("boot", "grub", "grub.cfg").content
    

提交回复
热议问题