I noticed that the machine I'm at has a floppy disk drive in it.  Can I use that drive to transfer files to my PC at home?

Yes, there is support on the Sun machines for transferring files to your PC machine using a floppy disk.

Insert your disk into the floppy disk drive and execute the command:

    volcheck

This instructs the Solaris operating system to check for disks in the removable media disk drives.

When volcheck detects the disk drive it creates a mount point for the drive at /floppy/floppy0.  You may want to create a link to this mount point in your home directory using the following command:

    ln -s /floppy/floppy0 a

This will make the floppy disk accessible to you as ~/a.  The command ls ~/a will generate a directory listing for the floppy disk.

You can copy files to or from the floppy disk or perform any other operations on them as if they were files stored somewhere in your Unix directory hierarchy.  You do need to be careful of the differences in file structure between Unix and the PC DOS world.   Binary files, like zip files, can copy directly.  With any text file, however, there is an incompatibility.  Unix uses a newline character as its end of line indicator whereas the PC world uses a carriage return followed by a newline character.   There are two programs, unix2dos and dos2unix, that can help you do the conversion.  To copy one of your java source files to the floppy disk you could use

    unix2dos -ascii file.java ~/a/file.java

There is also another set of tools known as the mtools that provide a full suite of programs for dealing with MS-DOS floppy disks.  The following is a table of some of these tools

Program Description
mcd change MSDOS directory
mcopy copy MSDOS files to/from Unix
mdel delete an MSDOS file
mdir display an MSDOS directory
mformat add an MSDOS filesystem to a low-level formatted diskette
mread read (copy) an MSDOS file to Unix
mtype display contents of an MSDOS file
mwrite low level write (copy) a Unix file to MSDOS

You can find out information about any one of these mtools by reading the man page for the command.  The floppy disk drive is referenced as a: similar to the way it is specified in the PC world.  For example, to copy a file from your floppy disk to the current Unix directory you would use the command

mcopy a:file

If the file is a text file then you would need to do ASCII end of line translation.   The command for this might be

mcopy -t a:file.txt ~/newname.txt

Oh, the last piece of information you would probably like to know is how to get your floppy disk out of the disk drive.  The command eject will do that for you.


version 1.2, 2001/01/08 18:12:01, © by csfac@RIT. All rights reserved.