Important: The information in this document is obsolete and should not be used for new development.
TranslateFile
You can useTranslateFileto translate a document from one format to another.
FUNCTION TranslateFile (sourceDocument: FSSpec; destinationDocument: FSSpec; howToTranslate: FileTranslationSpec) : OSErr;
sourceDocument- The document to translate.
destinationDocument- The file to put the translated document into.
howToTranslate- A buffer of information indicating how to translate the document.
DESCRIPTION
TheTranslateFilefunction reads the file specified by thesourceDocumentparameter and translates it into another format. You specify in thedestinationDocumentparameter the name and location of a file to contain the translated data. Note that your application only specifies the name and location for
the file;TranslateFilecreates the file and puts the translated data into it. The destination file must not exist before you callTranslateFile.The translation is performed according to the information provided in the
howToTranslateparameter. Usually, you'll get that information by callingCanDocBeOpened.SPECIAL CONSIDERATIONS
TheTranslateFilefunction is not available in all versions of system software; use theGestaltfunction to determine whether the Translation Manager is available before calling it.The
TranslateFilefunction might cause memory to be moved or purged; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theTranslateFileprocedure are
Trap macro Selector _TranslationDispatch $000C RESULT CODES