How to check if a drive exists
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
All the functions I gave are working here with xHarbour.Otto wrote:Hello NagesWaraRao,
thank you.
Yes, Set ErrorMode(1) with xHarbor is working.
local cDisk := "m"
// msginfo(DiskReady( cDisk, .F. ) )
Unresolved external '_HB_FUN_DISKREADY' referenced from
SetErrorMode(1)
msginfo(IsDisk( cDisk ) )
Regards,
Otto
With Harbour IsDisk( "A" ) is returning .t. or .f. without giving any OS message on XP. I do not know if this works with Vista too with Harbour.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Otto,
why don´t you use the function aDrives(), that comes with Fwh ? It collects all mounted drives. See sample testdrvs.prg in the sample dir.
You can easily check if a drive is available
It´s working in XP and Vista without any exception dialog
why don´t you use the function aDrives(), that comes with Fwh ? It collects all mounted drives. See sample testdrvs.prg in the sample dir.
You can easily check if a drive is available
Code: Select all
FUNCTION IsDrive (cDrive) // cDrive -> a:, c:, ....
LOCAL aDrv := aDrives()
RETURN (AScan (aDrv, cDrive)!=0)
kind regards
Stefan
Stefan
Hello Stefan, hello NagesWaraRao,
The aDrives-function executes the same exception dialog.
At the moment only xHarbour with ErrorMode(1) as NagesWaraRao suggested is working.
DiskReady( cDisk, .F. ) here gives a:
Unresolved external '_HB_FUN_DISKREADY' referenced from
But I don't use xHarbour in my project.
Regards,
Otto
The aDrives-function executes the same exception dialog.
At the moment only xHarbour with ErrorMode(1) as NagesWaraRao suggested is working.
DiskReady( cDisk, .F. ) here gives a:
Unresolved external '_HB_FUN_DISKREADY' referenced from
But I don't use xHarbour in my project.
Regards,
Otto
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Re: How to check if a drive exists
Otto,
I have the same problem as you with Card readers.
How did you solve it?.
As this error, I have problems with protect.prg
thanks
I have the same problem as you with Card readers.
How did you solve it?.
As this error, I have problems with protect.prg
thanks
Saludos,
Eduardo
Eduardo
Re: How to check if a drive exists
Hello, if I remember well I have reinstalled the card reader.
Best regards,
Otto
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: How to check if a drive exists
Hi,
Thanks for the reply.
It is not a question of drivers.
When a card reader is installed, it creates an USB letter drive for each slot. When there is NO card inserted, you can see the unit in My PC. If you click on it, the OS gives an error that there is not disk inserted in.
If you use GetDiskFreeSpaceEx of If file refering to the that Unit, the OS gives an error that there is not disk inserted in.
http://img40.imageshack.us/i/errorusb.png/
How did you solve that?.
thanks
Thanks for the reply.
It is not a question of drivers.
When a card reader is installed, it creates an USB letter drive for each slot. When there is NO card inserted, you can see the unit in My PC. If you click on it, the OS gives an error that there is not disk inserted in.
If you use GetDiskFreeSpaceEx of If file refering to the that Unit, the OS gives an error that there is not disk inserted in.
http://img40.imageshack.us/i/errorusb.png/
How did you solve that?.
thanks
Saludos,
Eduardo
Eduardo
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How to check if a drive exists
Hi Entico,
Seterrormode and DiskReady() are only in xHarbour, but I use Harbour.
Thanks
Seterrormode and DiskReady() are only in xHarbour, but I use Harbour.
Thanks
Saludos,
Eduardo
Eduardo
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How to check if a drive exists
It is called WAPI_SETERRORMODE() in Harbour.
EMG
EMG