Coder Social home page Coder Social logo

iso9660's People

Contributors

aarzilli avatar aminya avatar chtisgit avatar kdomanski avatar mat007 avatar oozie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

iso9660's Issues

Configurable option for disabling file renaming

Would it be possible to have a flag on the file writer so that if set, any files we write are not renamed to follow the correct standard?

I am working with legacy applications that use the incorrect naming convention and will reference files on the ISO which don't exist because of the file rename. Having to change the installer and all associated files to follow the new convention would be a painful process.

invalid argument error when trying to extract ISO to directory

I am trying to extract a ubuntu iso image (from https://releases.ubuntu.com/22.04/) to a temporary folder. Below is the code I am using

func ExtractISO() error {
	temp, err := os.MkdirTemp("temp", "ubuntu-")
	if err != nil {
		return fmt.Errorf("creating temp dir: %s", err)
	}
	iso_file, err := os.Open("ubuntu-22.04.3-live-server-amd64.iso")
	if err != nil {
		return fmt.Errorf("opening iso file: %s", err)
	}
	defer iso_file.Close()
	if err = util.ExtractImageToDirectory(iso_file, temp); err != nil {
		return fmt.Errorf("extracting image: %s", err)
	}
	return nil
}

I am getting hit with an error extracting image: open temp/ubuntu-4020240902/boot/grub/i386-pc/zstd.mod: invalid argument

I am not sure what the reason is, maybe the - in i386-pc?

EDIT: I just realized this might also be a permissions issue

Location is not available when trying to access a folder with Windows

package main

import (
    "log"
    "os"

	"github.com/kdomanski/iso9660"
)

func main() {
	writer, err := iso9660.NewWriter()
	if err != nil {
	  log.Fatalf("failed to create writer: %s", err)
	}
	defer writer.Cleanup()

	f, err := os.Open("myFile.txt")
	if err != nil {
	  log.Fatalf("failed to open file: %s", err)
	}
	defer f.Close()
  
	err = writer.AddFile(f, "MYFILE.TXT") // work
	if err != nil {
	  log.Fatalf("failed to add file: %s", err)
	}

	err = writer.AddFile(f, "random_folder_name/MYFILE.TXT") // doesn't work
	if err != nil {
	  log.Fatalf("failed to add file: %s", err)
	}
  
	err = writer.AddLocalDirectory("fixtures/test.iso_source", "fixtures/test.iso_source") // doesn't work
	if err != nil {
	  log.Fatalf("failed to add file: %s", err)
	}

	outputFile, err := os.OpenFile("output.iso", os.O_WRONLY | os.O_TRUNC | os.O_CREATE, 0644)
	if err != nil {
	  log.Fatalf("failed to create file: %s", err)
	}
  
	err = writer.WriteTo(outputFile, "testvol")
	if err != nil {
	  log.Fatalf("failed to write ISO image: %s", err)
	}
  
	err = outputFile.Close()
	if err != nil {
	  log.Fatalf("failed to close output file: %s", err)
	}
}

image

As anyone has been able to create a folder within the .iso file, mount the .iso, and access that folder using Windows?

Rock Ridge writing support

  • make RR writing the default, but allow disabling it

The RRIP defines the following System Use Entries:

  • PX POSIX file attributes
  • PN POSIX device number
  • SL Symbolic link
  • NM Alternate name
  • CL Child link
  • PL Parent link
  • RE Relocated directory
  • TF Time stamp(s) for a file
  • SF File data in sparse file format

In memory image creation

Currently, the package creates a temporary folder and copies the files into it to create the image. This can be avoided by using an in-memory creation.

Rock Ridge reading support

The RRIP defines the following System Use Entries:

  • PX POSIX file attributes (#44)
  • PN POSIX device number
  • SL Symbolic link
  • NM Alternate name (#34)
  • CL Child link
  • PL Parent link
  • RE Relocated directory
  • TF Time stamp(s) for a file
  • SF File data in sparse file format

Preserve last modifed time of files copy into ISO

Thanks for making this great tool. Seems like currently no such an API to file last modified time when they are added into ISO. Could you please tell me if it is limitation on ISO file format, or one missing feature? If later one, do you have any plan to add it?

allow setting dCharacters / cloud-init support

Hi kdomanski,

thanks for writing this useful library. I tried to use it in combination with cloud-init, but there files are named user-data, and meta-data. '-' is not in the valid set for dCharacters, which is perfectly fine, because it simply is not a valid char according to the iso9660 spec. On the other hand it is also known that many platforms are pretty relaxed when it comes to actual implementations. Adding '-' to the dCharacters worked fine on Linux.

Would you accept a patch that adds a SetdCharacters() to ImageWriter?

ISO9660 Compatibility issues?

Not sure if this is in scope of the project, however inorder to listen to podcasts in the car I have created:
https://github.com/arran4/podcast-cdr-manager

It successfully creates an ISO. My linux machine can read it:
image

However when I put it in the car:
image

( TOYOTA YARIS, RADIO/CD/DVD/SAT/TV, CD/MP3 PLAYER, NCP9#, SINGLE, 10/05-06/16 )

However when I burn the mp3s with K3b it works fine. (Default settings. It works, so it's not a CDRW issue.)

Testing it with just ISO9660 with K3b:

image

image

That seemed to work. So I suspect this might be an ISO issue OR an issue with how I'm using the library?

image

Adding multiple folders recursively

I am trying to add multiple files in the sourceFolders by using the walk function for each folder. However, it only adds one single file for some reason.

package main

import (
	"fmt"
	"log"
	"os"
	"path/filepath"
	"strings"

	"github.com/kdomanski/iso9660"
)

func main() {
	writer, err := iso9660.NewWriter()
	if err != nil {
		log.Fatalf("failed to create writer: %s", err)
	}
	defer writer.Cleanup()

	isoFile, err := os.OpenFile("C:/output.iso", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
	if err != nil {
		log.Fatalf("failed to create file: %s", err)
	}
	defer isoFile.Close()

	sourcePath := "F:\\"

	folders := []string{"F:\\test1", "F:\\test2"}

	for _, folderName := range folders {
		folderPath := strings.Join([]string{sourcePath, folderName}, "/")

		walk_err := filepath.Walk(folderPath, func(path string, info os.FileInfo, err error) error {
			if err != nil {
				log.Fatalf("walk: %s", err)
				return err
			}
			if info.IsDir() {
				return nil
			}
			outputPath := strings.TrimPrefix(path, sourcePath) // remove the source drive name
			fmt.Printf("Adding file: %s\n", outputPath)

			fileToAdd, err := os.Open(path)
			if err != nil {
				log.Fatalf("failed to open file: %s", err)
			}
			defer fileToAdd.Close()

			err = writer.AddFile(fileToAdd, outputPath)
			if err != nil {
				log.Fatalf("failed to add file: %s", err)
			}
			return nil
		})
		if walk_err != nil {
			log.Fatalf("%s", walk_err)
		}
	}

	err = writer.WriteTo(isoFile, "Test")
	if err != nil {
		log.Fatalf("failed to write ISO image: %s", err)
	}
}

Proposal: Please start using Semantic Versioning

I found that this project already supports Go modules. But sadly, the tags doesn't follow Semantic Versioning, which means that all tags of this project will be ignored by Go modules and replaced by pseudo-versions, go get acts weirdly when tags are not in that form. It would be great to have the tagged release be named in the format vX.X.X format so that go mod can read it.

$go get github.com/kdomanski/[email protected]
go get github.com/kdomanski/[email protected]: no matching versions for query "v0.2"
$go get github.com/kdomanski/iso9660
go: downloading github.com/kdomanski/iso9660 v0.0.0-20200713230927-fa56c38dc741
go: github.com/kdomanski/iso9660 upgrade => v0.0.0-20200713230927-fa56c38dc741

Else the mod file shows something like github.com/kdomanski/iso9660 v0.0.0-20200713230927-fa56c38dc741 which is not very readable and difficult to upgrade. It’s hard to verify which version is in use. This is not conducive to version control.

So, I propose this project to follow Semantic Versioning in future versions. For example, v1.0.1, v2.0.0, v3.1.0-alpha, v3.1.0-beta.2etc, so that other project can use tag in go.mod.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.