Board index » delphi » Re-read FAT after diskette exchange

Re-read FAT after diskette exchange

Hi!
I have the following problem:
sometimes a user of my program reads file from one diskette,
works with it, exchanges diskette and tries to save the file.
In this situation the program writes to the new diskette FAT
from the old one, completely destroying FAT structure.

Question: how can I force the program to re-read FAT before
trying to write something. Solution should work at XT.

Thank you in advance. E-mail copies of the response would be
appreciated.
--
Viatcheslav   mailto:neste...@em.uni-frankfurt.de
-------Knowledge is power. R.Bacon----------

 

Re:Re-read FAT after diskette exchange


set...@ix.netcom.com tipperte am 13.10.96 zum Thema "Re: Re-read FAT after diskette exchange":

Quote
> Assuming 5.25" 1.2M drives or any 3.5" drive, the normal solution would be
> to check the floppy's changeline status before writing to the disk.  Except
> that I don't think this works with a 360K drive (which would probably be
> more common on older XT systems).

> Perhaps a better solution would be to read back a part of the disk and
> compare it before updating the disk to see if the disk is different.  Not
> foolproof, but it would give a better line of defense on systems with drives
> that don't support the changeline signal.

Do it, like DOS does:
o if DOS < 3.3, the Diskette Label of the Disk stored either in the boot
  sector (format OS indicator) or the main directory.
o check the diskette serial number stored in the boot sector. DOS itself
  determines this way, if a diskette is changed.
Both methods imply that you either constantly check the drive or only once  
the disk is accessed after some time of break or after a disk error.
When you're searching for a file on the disk, there is no problem to check  
the boot sector before you read the FAT.

Greetings,
Franklin
--------------------------------------------------------------------------
            Franklin: EMail: frank...@stardate.westfalen.de
--------------------------------------------------------------------------
## CrossPoint v3.02 ##

Other Threads