Skip to content

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

@shellwhale

Description

@shellwhale
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions