mathematica 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #------------------------------------------------------------------------------
  2. # mathematica: file(1) magic for mathematica files
  3. # "H. Nanosecond" <aldomel@ix.netcom.com>
  4. # Mathematica a multi-purpose math program
  5. # versions 2.2 and 3.0
  6. #mathematica .mb
  7. 0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook
  8. 0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook
  9. # .ma
  10. # multiple possibilites:
  11. 0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook
  12. #>41 string >\0 %s
  13. #0 string (*^\n\n::[\011palette Mathematica notebook version 2.x
  14. #0 string (*^\n\n::[\011Information Mathematica notebook version 2.x
  15. #>675 string >\0 %s #doesn't work well
  16. # there may be 'cr' instread of 'nl' in some does this matter?
  17. # generic:
  18. 0 string (*^\r\r::[\011 Mathematica notebook version 2.x
  19. 0 string \(\*\^\r\n\r\n\:\:\[\011 Mathematica notebook version 2.x
  20. 0 string (*^\015 Mathematica notebook version 2.x
  21. 0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x
  22. 0 string (*^\r::[\011 Mathematica notebook version 2.x
  23. 0 string (*^\r\n::[\011 Mathematica notebook version 2.x
  24. 0 string (*^\n\n::[\011 Mathematica notebook version 2.x
  25. 0 string (*^\n::[\011 Mathematica notebook version 2.x
  26. # Mathematica .mx files
  27. #0 string (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*) Mathematica binary file
  28. 0 string (*This\ is\ a\ Mathematica\ binary\ Mathematica binary file
  29. #>71 string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000
  30. # >71... is optional
  31. >88 string >\0 from %s
  32. # Mathematica files PBF:
  33. # 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000
  34. 0 string MMAPBF\000\001\000\000\000\203\000\001\000 Mathematica PBF (fonts I think)
  35. # .ml files These are menu resources I think
  36. # these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\
  37. # how to put that into a magic rule?
  38. 4 string \ A~ MAthematica .ml file
  39. # .nb files
  40. #too long 0 string (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook Mathematica 3.0 notebook
  41. 0 string (*********************** Mathematica 3.0 notebook
  42. # other (* matches it is a comment start in these langs
  43. 0 string (* Mathematica, or Pascal, Modula-2 or 3 code
  44. #########################
  45. # MatLab v5
  46. 0 string MATLAB Matlab v5 mat-file
  47. >126 short 0x494d (big endian)
  48. >>124 beshort x version 0x%04x
  49. >126 short 0x4d49 (little endian)
  50. >>124 leshort x version 0x%04x