Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QTJ and long file names (OS X)



Hi,

I am hacking up a simple app to convert my CDs to MP4, but having trouble with file names.
Can anyone give me advice on how to write long files names with createMovieFile (or work around
it somehow)??


Problem one is the output file, created with:
outputFile.createMovieFile(StdQTConstants.kMoviePlayer, StdQTConstants.createMovieFileDeleteCurFile);

I keep getting QTIOException with error # -37 (Bad File Name) when writing files with long names.

a) Is there a way to use createMovieFile to create file names longer than 32 characters under OS X 10.2 ?
I believe this is just a length issues, but from Java I can say:
File testOut = new File(destDir, nameNoExt+"_evenmore.txt"); and create an even longer file name in the
same location.

If I change:
File outputFile = new File(destDir , nameNoExt + "mp4");
to
File outputFile = new File(destDir , "Song_"+ i + ".mp4");

Then the name is short enough and everything works fine. But, I would like to keep the song name at
full length of course. I am wary of just truncating the file name to max length (31?) in case I overwrite
duplicate songs, like:
Some_Very_Very_Long_Obscure_Song_Part_I.mp4
Some_Very_Very_Long_Obscure_Song_Part_II.mp4

in the early days of OS X I remember some carbon apps made some hash function or
something, truncating file names to "Some_Very_Very_Long_F4D5G.mp4" (for Part 1)
and "Some_Very_Very_Long_ZXDF3.mp4" (For part 2)

Any thoughts or advice?

Details:

Running Stock OS 10.2.2 with all released updates (not prerelease Java or QTJ or anything)
on a TiBook800.

Basically, I stick in a CD, iTunes queries the CDDB thing and renames the CD to the title, and the
individual song files on the CD to the song title. Perfect!

Now I run my program, taking each CD file name, and changing the extension to .mp4
and replacing spaces with _
For instance, one problem disc has:
Could not create the output file:/private/tmp/The_Dream_Of_The_Blue_Turtles/ 1_If_You_Love_Somebody_Set_Them_Free.mp4
quicktime.io.QTIOException[QTJava:6.0.0g2],(error: -37),QT.vers:6028000
[java] at quicktime.io.QTFile.path2Spec(QTFile.java:496)
[java] at quicktime.io.QTFile.getFSSpec(QTFile.java:280)
[java] at quicktime.io.QTFile.createMovieFile(QTFile.java:379)
[java] at adenzo.quicktime.audio.ConvertFileToMpeg4.transcode(ConvertFileToMpeg4.j ava:85)
...

Steve , email@hidden
Perth, WA, Australia
_______________________________________________
quicktime-java mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-java
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.