Computing.Net > Forums > Unix > Transfering text files to dos

Transfering text files to dos

Reply to Message Icon

Original Message
Name: thinnner
Date: June 15, 2001 at 12:45:37 Pacific
Subject: Transfering text files to dos
Comment:

How would i take a few text files on a unix box and put them on a floppy to be read in a Dos environment?


Report Offensive Message For Removal

Response Number 1
Name: Don Arnett
Date: June 15, 2001 at 22:27:19 Pacific
Subject: Transfering text files to dos
Reply: (edit)

If you have the proper access to the machine, the easiest thing is to FTP the files between the UNIX box and the PC. If they are text files, be sure to set it to ASCII mode.

Or if you have access to email on the Unix box, send them via email to a PC account.

SCO UNIX systems have commands to copy files to DOS floppies. Try 'man doscp' to see if you have docs on this.


Report Offensive Follow Up For Removal

Response Number 2
Name: phatter
Date: June 18, 2001 at 13:15:42 Pacific
Subject: Transfering text files to dos
Reply: (edit)

you could try this small C program:

#include \
#include \

int main(int argc, char *argv[])
{
FILE *ifp, *ofp;
char ch;

if (argc != 3) exit(1);
ifp = fopen(argv[1], "r");
ofp = fopen(argv[2], "w");
if (ifp == 0 || ofp == 0) exit(1);
while ((ch = getc(ifp)) != EOF) {
if (ch != '\n')
putc(ch, ofp);
else
{ putc(13, ofp); putc(10, ofp); }
} /* end while */
fclose(ofp);
fclose(ifp);
} /* end of main() program! */

You can use mtools (or some similar utilities) to dos format and then copy the output file from the command-line to a floppy.


Report Offensive Follow Up For Removal

Response Number 3
Name: Me
Date: June 29, 2001 at 08:45:20 Pacific
Subject: Transfering text files to dos
Reply: (edit)

I forget to add that DOS End-of-File marker, so before closing the file:

fputc(26, ofp);



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Transfering text files to dos

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software