troubleshooting Question

Algorithm for File name mangling

Avatar of petermorrone
petermorrone asked on
22 Comments1 Solution398 ViewsLast Modified:

I need a c++ algorithm that takes a file path like ..

c:\folder 1\Long folder name\Longer Folder name itfsdaf\longFileName.somelongext

basically, any valid window file path...

and mangles it into a ISO9660 complient string (both standard and level 1 interchange).  

The details of the specification are below..

There are a few restrictions in ISO9660 that you must know before you commence your CD-R or CD-RW creation:

All filenames and directory names must use Capital letters "A-Z", Digits "0-9" and Underscore "_";
The number of characters of filenames plus extensions must not exceed 30;
Directory names cannot have any extensions, and cannot exceed 30 characters
There are 3 levels under ISO9660 that has further restriction respectively:

ISO9660 Level 1 Interchange further restricts that file names cannot exceed 8, filename extensions cannot exceed 3 and directory names (no extension allowed) cannot exceed 8. All files must be contiguous, or cannot be recorded in interleave mode;

The algorithm must of course handle mangled name conflicts as well and generate the new mangled name.

I need to find an algorithm that I can legally use in my commercial application with no restriction.  Does anyone know of source code to such an algorithm.  I am aware that some of the gnu libraries have some But I dont think I can freely use them without credit etc.
Senior Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 22 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros