Document Types > Porting Document Types > Source Files
  
Source Files
Make sure all source files are text-only files. Source files include the specification files (the .dtd, .fos, .dcf, and perhaps the catalog file) and all SGML instance files (including any templates or sample files).
* 
If they are Windows files, you do not need to transfer them. If the files originated from a UNIX system, there are a number of methods to transfer them to Windows format. If the files originated from another UNIX machine they are already in UNIX format. If the files are from Windows, there are a number of methods to transfer them to UNIX format.
UNIX file names may be too long to be used on some Windows operating systems. Some systems may limit file names to 8 characters for the file name, plus a 3 character extension. Therefore, you should make .sgml files (documents) in UNIX into .sgm files. Other specification source files should also keep the same extension they have under UNIX.
The easiest way to transfer files to a UNIX system from a Windows system is to use a file transfer protocol such as FTP, Kermit, and so forth. Usually, such protocols handle the file format conversion automatically, so that a Windows text file ends up in the format of a UNIX text file when transferred to the UNIX system (or vice versa).
If your transfer method does not automatically convert files, there is usually a utility on the UNIX system or on Windows that will do this.
* 
A commonly used utility is unix2dos. Use this utility to create copies of the UNIX source files in DOS format and then transfer the copies to the target PC.
If no utility is available for this purpose, you can use the UNIX command sed to alter the source files. The syntax for sed is:
sed 's/$/[Control]-v [Control]-m/' source > target [Return]
[Control]-letter indicates holding down the control key followed by the letter indicated. This appears on the screen as the following: sed 's/$/^M/' source > targetSource is the UNIX source file name, and target is the DOS file that will be created. Do not use the same name for both source and target files or you may damage the source file. After converting the files, transfer the DOS format copies of the source files to the appropriate location on the PC.