This article was previously published under Q57345
This article has been archived. It is offered "as is" and will no longer be updated.
There are several methods that can be used to transfer text files fromMS-DOS-based computers to Macintosh computers. Binary data files cansometimes be transferred, depending on the format of the informationthey contain. It is useless to transfer binary executable programfiles, as the machine code of MS-DOS computers (based on the Intelchip set) and the Macintosh computers (based on the Motorola chip set)is very different.
This information applies to Microsoft QuickBASIC for the MacintoshVersion 1.00, to Microsoft QuickBASIC Versions 4.00, 4.00b, and 4.50for MS-DOS, to Microsoft BASIC Compiler Versions 6.00 and 6.00b forMS-DOS and MS OS/2, and to Microsoft BASIC Professional DevelopmentSystem (PDS) Version 7.00 for MS-DOS and MS OS/2.
The following are several methods for transferring files between theMacintosh and MS-DOS-based computers:
Newer Macintoshes (current versions of the SE and all models introduced after the IIx, including the Macintosh IIci, IIcx, and the Macintosh portable) include the super drive. This drive is able to read from and write to MS-DOS-formatted disks with the addition of a special INIT.
A company called Dayna Communications produces an INIT called DOS Mounter that allows super-drive-equipped computers to read from and write to MS-DOS formatted disks. Dayna Communications can be reached at (801) 531-0600.
Files can also be transferred between MS-DOS machines and Macintoshes by hooking them together through serial ports and using communication programs to transfer the information.
A special null-modem cable that is specially designed to connect Macintoshes and MS-DOS-based computers must be used.
Modems can be attached to both computers, and the modems can be hooked together to transfer data. This requires using a communications program on both machines and having a modem connected to both the Macintosh and the MS-DOS-based machine.
The TOPS Network can be used to hook IBM-compatible computers and Apple Macintosh computers together. Files can then be transferred over this network. A TOPS FlashCard network card is required for the IBM-compatible computer, and both the IBM-compatible and Macintosh computers need special network driver software.
The TOPS Network is produced by TOPS, a Sun Microsystems company. TOPS can be reached at (408) 562-6000.
A company called Micro Solutions produces an IBM compatible card and disk drive called MatchMaker that allows IBM-compatible computers to read from and write to Macintosh disks. Micro Solutions can be reached at the following address and phone number:
Micro Solutions 132 W Lincoln Hwy Dekalb, IL 60115 (815) 756-3411
Records in Macintosh text files are delimited just by carriage returnsand not by carriage return plus linefeed sequences as on MS-DOScomputers. This can cause problems when transferring MS-DOS text filesto the Macintosh and vice versa. The following two sections discussthis issue.
Transferring Text Files from IBM to Macintosh
The interpreter environment in Microsoft QuickBASIC for the AppleMacintosh automatically accepts source code files that have linefeedsat the end of lines.
When reading a text data file that was created on an IBM into aMacintosh program, the extra linefeeds may appear as small squareboxes. The square box is the Macintosh's representation for thelinefeed. The linefeeds need to be stripped from the file for theMacintosh to work with the file.
After transferring a file from IBM to Macintosh, you might want tochange the file's type to TEXT if the transfer utility (program) doesnot do it for you. The following are two ways to change a file's typeto TEXT:
Run the following statements in QuickBASIC:
x$="filename" NAME x$ AS x$, "TEXT"
Run ResEdit and select the file that you transferred. Press COMMAND+I or choose Get Info from the File menu. In the box that pops up, change whatever is in the TYPE box to "TEXT" or the appropriate type. Close the box and choose to save the changes.
If you also want to change the creator type to determine whichapplication loads when you double-click the text file, query in thisKnowledge Base for the following words:
SetCreate and creator and double-click
Transferring Text Files from Macintosh to IBM
When text files created on the Macintosh are displayed on an MS-DOScomputer, they will have all the lines of data on one line. This is aresult of the Macintosh not appending a linefeed to the end of eachline of text. This problem can be solved by writing a program on theMacintosh that will append the required linefeed onto the end of eachline of text (as shown in the Code Example below). The file can thenbe transferred over to the MS-DOS computer.
The following source code, written for Microsoft QuickBASIC Version1.00 for the Apple Macintosh, will read in a text file and outputanother text file that is in a suitable format (carriage return pluslinefeed terminating each line) for reading on an MS-DOS-basedmachine:
INPUT "Source file name: "; SFILE$ INPUT "Output file name: "; OFILE$ OPEN SFILE$ FOR INPUT AS #1 OPEN OFILE$ FOR OUTPUT AS #2 WHILE NOT(EOF(1)) LINE INPUT #1, A$ PRINT #2, A$ ' Don't use a semicolon after A$. PRINT #2, CHR$(10); ' Appends a linefeed character on each line. WEND CLOSE #1 CLOSE #2 PRINT "All Done!"