3
$\begingroup$

I am seeing a weird behavior on exporting at least one type of file (here, a QuickTime movie) to files with long names. If I do this:

In[19]:= Export["Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.dat", {42}]
Export["Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.mov", {42}]
FileNames["Lorem*"]

it hurts:

Out[19]= "Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.dat"
Out[20]= "Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.mov"
Out[21]= {"Lorem-ipsum-dolor-s#123C8BE.mov", \
"Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.dat"}

The .dat file has the correct name and the .mov file hasn't, even though Export tries to make me think it has.

My questions are:

  • This is not on a MS-DOS box, but with Mathematica 8.0.0.0 on Mac OS 10.7.3 (64-bit kernel). Can you comment if other versions/operating systems reproduce this issue?
  • Although I find nothing with Google, is this a known bug and is there a fix?
$\endgroup$
4
  • 2
    $\begingroup$ A similar problem occurs exporting a QuickTime movie with a very long name using Apple Final Cut Pro, so it might be related to the creation of a temporary file that is then wrongly renamed. $\endgroup$
    – VLC
    Commented Apr 5, 2012 at 13:14
  • 2
    $\begingroup$ I tried reproducing the issue on 8.0.4/Windows 7/x64, and couldn't, receiving this message: "Export::installreq: "QuickTime" format is supported only if "QuickTime Player" is installed." That suggests to me that @vucko is correct, and the problem is on Apple's side. $\endgroup$
    – Pillsy
    Commented Apr 5, 2012 at 13:34
  • $\begingroup$ Same with me (Win7, 64bit, Mathematica 8.0.4): Export::erropts: The value Cinepak specified for the option VideoEncoding is invalid. >>, and there is no second file appearing at all. $\endgroup$ Commented Apr 5, 2012 at 13:41
  • $\begingroup$ With Mathematica 8.0.0.0 on Linux, it complains Export::infer: Cannot infer format of file Lorem-ipsum-dolor-sit-amet-consectetur-adipisicing-elit.mov. and also creates only the .dat. $\endgroup$
    – celtschk
    Commented Apr 5, 2012 at 13:56

1 Answer 1

5
$\begingroup$

The problem is not with Mathematica, but with the quicktime plugin/codec. The reason you see this error is that earlier versions of OSX (version 9 and below) had an upper limit of 31 characters for the filename (27, if you include the extension). Today's systems allow up to 255 characters, but the plugin still forces the filename to be backwards compatible. It is not related to a temporary file not being renamed.

StringLength["Lorem-ipsum-dolor-s#123C8BE.mov"]
Out[1]= 31

Final Cut Pro's manual tells you about this (but leaves the choice of truncating to the user):

Although current file systems such as HFS+ (used by Mac OS X) allow you to create filenames with a 255-character limit, you may want to limit your filename length if you intend to transfer your files to other operating systems. Earlier versions of the Mac OS allow only 31-character filenames, and if you want to include a file extension (such as .fcp, .mov, or .aif), you need to shorten your Mac OS 9-compatible filenames to 27 characters.

Couple of other examples where people have been bitten by this behavior. AFAIK, the workaround is to rename the file after exporting.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.