Hi All.
The idea behind deleting everything off a disk was to clear the room for a
backup.
It also must be a check that the medium is removable, not hard disk
before the clear/delete proc is instigated.
Just in case anyone ever is going to use such a destructive call as the prior
deletefile mooted, you should use the following check as well:
var drvtype:word;
.................
Drive := IncludeTrailingBackSlash(Drive + ':');
//make sure drive is removeable type
drvtype := GetDriveType(pchar(Drive));
if (drvtype=DRIVE_REMOVABLE) or (drvtype=DRIVE_CDROM)
//turn the cooker on
then deltree(drive);
Just in case u were wondering; no I did not learn by bad experience!
Cheers,
Al+
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/