Skip to content

ISO file creation returns an archive size of 0, while gzip creation works fine #71

@suntranscend

Description

@suntranscend

When attempting to create an ISO file using libarchive.js, the returned archive size is 0 bytes.
However, when creating a gzip file with the same process and files, the output is correct and functional.
Below is the code snippet used for creating the ISO file:

import {
  Archive,
  ArchiveFormat,
  ArchiveCompression,
} from 'libarchive.js/dist/libarchive.js';

// `files` is the files of the input of the file type.
const allFiles = [];
for (let i = 0; i < files.length; i++) {
  const file = files[i];
  const relativePath =
    file.webkitRelativePath || file.relativePath || file.name;
  allFiles.push({ file, pathname: relativePath });
}

const archiveFile = await Archive.write({
  files: allFiles,
  outputFileName: 'mount.iso',
  compression: ArchiveCompression.NONE,
  format: ArchiveFormat.ISO9660,
  passphrase: null,
});

Steps to Reproduce:

Prepare a list of files to be included in the archive (allFiles).
Use the above code snippet to attempt to create an ISO file.
Check the size of the generated mount.iso file.

Expected Behavior:

The ISO file should be created with the appropriate size, containing all the specified files.

Actual Behavior:

The generated ISO file (mount.iso) has a size of 0 bytes.

Additional Information:

  • The same process works correctly when creating a gzip file.
  • The issue seems to be specific to the ISO creation format.
  • No errors or warnings are thrown during the process.

Environment:

  • Library Version: [email protected]
  • Browser: Chrome 125.0.6422.113
  • Operating System: windows 10

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