Re: How to create a proper size UDF image?
Hi Jörg, This patch works. All the file names can be read successfully. Thank you. But the longest name is truncated by one char without any warning message. IMHO, it's better to add an option that those too long names are reported instead of being truncated directly. -- WF -- Original -- From: "Joerg Schilling"; Date: Thu, Jan 25, 2018 02:01 AM To: "feng.wang"; "cdwrite"; Subject: Re: How to create a proper size UDF image? ?? wrote: > Hi Jörg, > > > > I just verified that your problem is also present on Solaris, so I would > > need to > fix it in mkisofs. > > > This may take a few days, as I need to understand what's happening when > > there > are more than 2 of these characters Hi, could you test this patch: --- joliet.c --- --- /tmp/sccs.D8aOtz2015-12-30 19:04:32.953572000 +0100 +++ joliet.c2018-01-24 19:00:01.459473000 +0100 @@ -257,6 +257,8 @@ unsigned char uc; int jsize = size; + jsize = strlen(source); + /* * If we get a NULL pointer for the source, it means we have an * inplace copy, and we need to make a temporary working copy first. @@ -344,6 +346,8 @@ unichar = '_'; } all_chars: + if (unichar == 0) + unichar = '_'; ; } buffer[i] = unichar >> 8 & 0xFF; /* final UNICODE */ Jörg -- EMail:[email protected](home) Jörg Schilling D-13353 Berlin [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/file
Re: How to create a proper size UDF image?
Hi Jörg, > I just verified that your problem is also present on Solaris, so I would need > to fix it in mkisofs. > This may take a few days, as I need to understand what's happening when there are more than 2 of these characters That's OK. Many thanks for your help. -- WF
Re: How to create a proper size UDF image?
Hi Jörg, >> >> But I find the Chinese characters (UTF-8 charset) are not supported very >> well. The commands I used are the following. >> root@Ubuntu:~# ls long-name/ >> ?.1 >> ??.2 >> ???.3 >> .4 >> ?.5 >> ??.6 > Could you please mention the hex code for that chinese character? The hex code is "4E2D". >> ... ... >> root@Ubuntu:~# /opt/schily/bin/mkisofs -UDF -o a.udf ./long-name >> Setting input-charset to 'UTF-8' from locale. >> Total translation table size: 0 >> Total rockridge attributes bytes: 0 >> Total directory bytes: 0 >> Path table size(bytes): 10 >> Max brk space used 0 >> 507 extents written (0 MB) >> >> >> root@Ubuntu:~# mount ./a.udf /mnt >> mount /root/a.udf >> >> >> root@Ubuntu:~# ls /mnt >> ?.1 >> ??.2 >> ???#00A6._ >> _#D14D >> ?_#7C02 >> ??_#8F1A >> >>.. >> >> >> We can see that some filenames cannot be read correctly. > What OS did you use to mount the filesystem? > Are you sure that the OS is bug free? I am using an old ubuntu system with the kernel version 3.13.0-100-generic. > Could you provide a tar archive that contains the files (0 bytes for each is OK)? Yes, I just created these files using "touch" command. Please find the attached tar file. > > > mkisofs -UDF -print-size >> >> > gives you the size. > > >> Well that's what I want. It's really useful feature. Does it count the size >> of entries? I mean that one directory may have thousands small files. The >> directory's entry size cannot be negligible. > This is the number of 2048 byte blocks that will be in the FS image in total. OK. -- WF long-name.tgz Description: Binary data
Re: How to create a proper size UDF image?
Hi Jörg, ?? wrote: >> I know that some tools like mkisofs could make files to a udf image directly >> with efficient size. However the size created by mkisofs could be larger >> than the media size. What's more, the udf filesystem made by mkisofs is a >> UDF hybrid and not a UDF only filesystem. > Why do you have a problem with a hybrid? > This usually does not increase the size in a way that is relevant. I once used mkisofs but it did not support uid and gid. Now I update it to the latest version (3.02a09), this problem is resolved. But I find the Chinese characters (UTF-8 charset) are not supported very well. The commands I used are the following. root@Ubuntu:~# ls long-name/ 中.1 中中.2 中中中.3 .4 中.5 中中.6 ... ... root@Ubuntu:~# /opt/schily/bin/mkisofs -UDF -o a.udf ./long-name Setting input-charset to 'UTF-8' from locale. Total translation table size: 0 Total rockridge attributes bytes: 0 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 507 extents written (0 MB) root@Ubuntu:~# mount ./a.udf /mnt mount:块设备 /root/a.udf 写保护,将以只读方式挂载 root@Ubuntu:~# ls /mnt 中.1 中中.2 中中中#00A6._ _#D14D 中_#7C02 中中_#8F1A .. We can see that some filenames cannot be read correctly. >> So is there a rational method to get the rough size of a UDF image file to >> be created if we know the directory tree and sizes of files needed to be >> burned? I think 10% larger size overhead could be acceptable. > I recommend to use mkisofs, as this creates a proper readonly UDF. > mkisofs -UDF -print-size > gives you the size. Well that's what I want. It's really useful feature. Does it count the size of entries? I mean that one directory may have thousands small files. The directory's entry size cannot be negligible. -- WF

