Hello,
I have found the file renaming scheme used by mkisofs to be inadequate for
certain purposes which come up for me. The current renaming scheme
does not preserve filename extensions in the event of name conflicts.
This causes MSWindows, MSDOS and MP3 CD players not to recognize
certain files of interest. I have modified the renaming scheme in "tree.c"
in sort_n_finish to preserve the filename extension and instead change
the rootname of the filename.
I've also sent these diffs to Eric Young. I suppose that someone might
want to make this a command line option, although I can see no reason
why one would prefer to have the filename extension not preserved.
I used mkisofs-1.12b5 as the source for these modifications.
Here are the context diffs:
*** tree.c Tue Dec 19 14:51:57 2000
--- orig/tree.c Sun Mar 7 10:41:19 1999
***************
*** 168,174 ****
int tablesize = 0;
char newname[34];
char rootname[34];
- char orig_ext[34] = "\0";
/* Here we can take the opportunity to toss duplicate entries from the
directory. */
--- 168,173 ----
***************
*** 238,267 ****
*/
c = strchr(rootname, '.');
if (c)
! {
! /* MJG 2000dec19:
! // Keep a copy of the original 3-letter filename extention.
! */
! char *ext = c + 1;
! if(strlen(ext)) {
! strcpy(orig_ext, ext);
! orig_ext[3] = '\0';
! } else {
! orig_ext[0] = '\0';
! }
!
! /* Eliminate the extension from the rootname */
! *c = 0;
!
! /* MJG 2000dec19:
! // Make sure numerals can fit in the rootname
! // to try to make it unique.
! */
! if(strlen(rootname) > 5) {
! c = &rootname[5];
! *c = '\0';
! }
! }
else
{
c = strchr(rootname, ';');
--- 237,243 ----
*/
c = strchr(rootname, '.');
if (c)
! *c = 0;
else
{
c = strchr(rootname, ';');
***************
*** 273,283 ****
{
for(d3 = 0; d3 < 36; d3++)
{
! sprintf(newname,"%s%c%c%c.%s%s", rootname,
(d1 <= 9 ? '0' + d1 : 'A' + d1 - 10),
(d2 <= 9 ? '0' + d2 : 'A' + d2 - 10),
(d3 <= 9 ? '0' + d3 : 'A' + d3 - 10),
- orig_ext,
(s_entry->isorec.flags[0] == 2 ||
omit_version_number ? "" : ";1"));
--- 249,258 ----
{
for(d3 = 0; d3 < 36; d3++)
{
! sprintf(newname,"%s.%c%c%c%s", rootname,
(d1 <= 9 ? '0' + d1 : 'A' + d1 - 10),
(d2 <= 9 ? '0' + d2 : 'A' + d2 - 10),
(d3 <= 9 ? '0' + d3 : 'A' + d3 - 10),
(s_entry->isorec.flags[0] == 2 ||
omit_version_number ? "" : ";1"));
--
Dr. Michael J. Gourlay Research Scientist
"That's me; I've been ionized...." - Buckaroo Banzai
NWRA/Colorado Research Assoc: Boulder, CO 80301; 303-415-9701x203 FAX:415-9702
[EMAIL PROTECTED] http://www.colorado-research.com/~gourlay/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]