program dosimage; uses crt,device,open; {----------------------------------------------------------------} procedure read_fdd(filename:string); begin writeln; writeln('Please insert a 1.44Mb source disk'); writeln('into drive A: and press [ENTER]'); readln; writeln('Reading source disk....'); writeln; read_disk(0,filename,true); writeln('Copy completed!'); writeln; end; {----------------------------------------------------------------} procedure write_fdd(filename:string); begin writeln; writeln('Please insert a 1.44Mb formated destination'); writeln('disk into drive A: and press [ENTER]'); readln; writeln('Writing destination disk....'); writeln; write_disk(0,filename,true); writeln('Copy completed!'); writeln; end; {----------------------------------------------------------------} begin if (paramstr(1)='/?') or (paramstr(1)='') then begin writeln; writeln('DOSIMAGE written by Franz-Josef Ayestaran (c)1999'); writeln('--------'); writeln; writeln('This program allows the user to backup MS-DOS and UNIX'); writeln('floppy disks to an image file ready to be restored back'); writeln('to a formated floppy disk at a later date.'); writeln; writeln('r: read from 1.44Mb floppy disk to hard drive'); writeln('w: write to 1.44Mb floppy disk from hard drive'); writeln; writeln('Usage: dosimage '); writeln; halt; end; if (paramstr(1)='R') or (paramstr(1)='r') then begin read_fdd(paramstr(2)); end; if (paramstr(1)='W') or (paramstr(1)='w') then begin if does_file_exist(paramstr(2)) then begin write_fdd(paramstr(2)); end; if does_file_exist(paramstr(2))=false then begin write('File: <',paramstr(2),'> not found!'); writeln; end; end; end.