Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
suntranscend opened this issue May 28, 2024 · 0 comments

Comments

@suntranscend
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant