Board index » delphi » Check if disk is read-only (CD-ROM)

Check if disk is read-only (CD-ROM)

Hi, I use D4 and BDE5.01. I need to check if the disk where my database is
stored, is Read only (for example CD-ROM). So that I can set TTable.ReadOnly
property to True, to prevent writing.

(I also have put  PDOXUSRS.LCK file in CD-ROM.)

Thanks in advance,
Renzo Contarini

 

Re:Check if disk is read-only (CD-ROM)


On Thu, 11 Mar 1999 12:57:13 +0100, "Renzo Contarini"

Quote
<rco...@sierrasoft.com> wrote:
>Hi, I use D4 and BDE5.01. I need to check if the disk where my database is
>stored, is Read only (for example CD-ROM). So that I can set TTable.ReadOnly
>property to True, to prevent writing.

Renzo,

  if GetDriveType('D:\') = DRIVE_CDROM then

If you want to check if the data directory is on a write-protected
disk in general, I suppose you can also use the GetFileAttributes()
WinAPI function.

Hope this helps,

Jan

Other Threads