Transferring Files Between Macintosh and MS-DOS Computers (57345)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q57345

SUMMARY

There are several methods that can be used to transfer text files from MS-DOS-based computers to Macintosh computers. Binary data files can sometimes be transferred, depending on the format of the information they contain. It is useless to transfer binary executable program files, as the machine code of MS-DOS computers (based on the Intel chip set) and the Macintosh computers (based on the Motorola chip set) is very different.

This information applies to Microsoft QuickBASIC for the Macintosh Version 1.00, to Microsoft QuickBASIC Versions 4.00, 4.00b, and 4.50 for MS-DOS, to Microsoft BASIC Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2, and to Microsoft BASIC Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2.

MORE INFORMATION

The following are several methods for transferring files between the Macintosh and MS-DOS-based computers:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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 returns and not by carriage return plus linefeed sequences as on MS-DOS computers. This can cause problems when transferring MS-DOS text files to the Macintosh and vice versa. The following two sections discuss this issue.

Transferring Text Files from IBM to Macintosh

The interpreter environment in Microsoft QuickBASIC for the Apple Macintosh automatically accepts source code files that have linefeeds at the end of lines.

When reading a text data file that was created on an IBM into a Macintosh program, the extra linefeeds may appear as small square boxes. The square box is the Macintosh's representation for the linefeed. The linefeeds need to be stripped from the file for the Macintosh to work with the file.

After transferring a file from IBM to Macintosh, you might want to change the file's type to TEXT if the transfer utility (program) does not do it for you. The following are two ways to change a file's type to TEXT:

  1. Run the following statements in QuickBASIC:
          x$="filename"
          NAME x$ AS x$, "TEXT"
  2. 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 which application loads when you double-click the text file, query in this Knowledge 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-DOS computer, they will have all the lines of data on one line. This is a result of the Macintosh not appending a linefeed to the end of each line of text. This problem can be solved by writing a program on the Macintosh that will append the required linefeed onto the end of each line of text (as shown in the Code Example below). The file can then be transferred over to the MS-DOS computer.

The following source code, written for Microsoft QuickBASIC Version 1.00 for the Apple Macintosh, will read in a text file and output another text file that is in a suitable format (carriage return plus linefeed terminating each line) for reading on an MS-DOS-based machine:
   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!"
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB57345 kbAudDeveloper