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 label #40

Open
atrdev-rgb opened this issue Jan 17, 2020 · 5 comments
Open

Iso label #40

atrdev-rgb opened this issue Jan 17, 2020 · 5 comments

Comments

@atrdev-rgb
Copy link

How create udf image from python with pycdlib, and take him custom label (name of disk)?

@clalancette
Copy link
Owner

So, as of right now, pycdlib supports creating UDF images, but only in the "bridged" format along with ISO9660. That is, the resulting disc will be a hybrid UDF/ISO9660 ISO. I've been doing some ongoing work to allow pure UDF discs, but it isn't complete yet.

If you are OK with this limitation, then you should be able to do something like this:

import pycdlib
iso = pycdlib.PyCdlib()
iso.new(vol_ident='custom label', udf='2.60')
iso.add_file('local_filename', udf_path='filename_on_iso')
iso.add_directory(udf_path='dir_name_on_iso')
etc.
iso.write('output_file.iso')
iso.close()

Does this answer your question?

@atrdev-rgb
Copy link
Author

atrdev-rgb commented Jan 19, 2020

after creating the image, when mounting it or recording it in the program, the name of the disc does not change, namely title "CDROM".
vol_ident='custom label' not working

default vol_ident takes from:

class UDFFileSetDescriptor(object):
def new(self):
self.log_vol_ident = _ostaunicode_zero_pad('CDROM', 128)

and not change on custom

@atrdev-rgb
Copy link
Author

atrdev-rgb commented Feb 11, 2020

Hi friend. so with a bug when creating udf. how to do with your disk name. i am install on python.
pip install pycdlib

@clalancette
Copy link
Owner

Yeah, sorry, I see what you mean about this. Basically, we need to pass the vol_ident from the new() method down into the UDF creation stuff, and then set it as appropriate.

I'll put this on my list of things to do, but I may not get to it for a little while. If you open a pull request to do this, I'm happy to review it.

@vtgdias
Copy link

vtgdias commented Mar 30, 2022

So, as of right now, pycdlib supports creating UDF images, but only in the "bridged" format along with ISO9660. That is, the resulting disc will be a hybrid UDF/ISO9660 ISO. I've been doing some ongoing work to allow pure UDF discs, but it isn't complete yet.

If you are OK with this limitation, then you should be able to do something like this:

import pycdlib
iso = pycdlib.PyCdlib()
iso.new(vol_ident='custom label', udf='2.60')
iso.add_file('local_filename', udf_path='filename_on_iso')
iso.add_directory(udf_path='dir_name_on_iso')
etc.
iso.write('output_file.iso')
iso.close()

Does this answer your question?

I am using the exact same code but could not make it work. Always show CDROM, no matter what.

self.iso = pycdlib.PyCdlib()
self.iso.new(vol_ident='Test', vol_set_ident='Test', udf='2.60')

I oppened the resulting iso image with windows (builtin mount) and with burnimg. BurnImg indicates me that the version of UDF i am using is 1.02 (not the one i set with udf='2.60'), this is because of the bridge?

I made my own function to add directories recursivelly but was wondering if there is a better way or maybe a flag to do that (i used os.walk).

tks in advance

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

3 participants