BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detecting Floppy Disk Media Change.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
pfmkcay
Guest





PostPosted: Tue Jun 21, 2005 5:02 pm    Post subject: Detecting Floppy Disk Media Change. Reply with quote




I am writing an application using Borland C++ Builder Version 6. The application will run on a computer that uses the Windows XP operating system. Data is transferred on and off of this computer using a 3.5" floppy disk. I would like for my application to be able to detect when a disk is inserted or removed from this drive. I would prefer to accomplish this without polling the floppy drive since that will start the drive motor each time. My application needs to run 24/7 for several years and I'm concerned that starting the motor that many times will wear it out.

Do floppy drives generate events when media is inserted or removed? Is there a way to detect these events?

Thank you.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Jun 21, 2005 5:46 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote




"pfmkcay" <pfmckay (AT) sandia (DOT) gov> wrote


Quote:
I would like for my application to be able to detect when a disk is
inserted or removed from this drive. I would prefer to accomplish
this without polling the floppy drive since that will start the drive
motor each time

Unless the floppy drive supports "Auto-Insert Notification" (which most do
not), you will have to poll as there will not be any insert/removal
notifications.

Quote:
My application needs to run 24/7 for several years

Windows itself can't even run 24/7 for several years. It has to be rebooted
periodically.

Quote:
Do floppy drives generate events when media is inserted or removed?

No. Can you use CD/DVD disks instead? They generate notifications.


Gambit



Back to top
Jonathan Benedicto
Guest





PostPosted: Tue Jun 21, 2005 6:18 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote



"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote


Quote:
No. Can you use CD/DVD disks instead? They generate notifications.

What about USB memory sticks ?

Jonathan



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Jun 22, 2005 7:31 am    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote


"Jonathan Benedicto" <incorrect (AT) no (DOT) server> wrote


Quote:
What about USB memory sticks ?

I would imagine so, but that is vendor-specific whether the device actually
does os or not.


Gambit



Back to top
Jonathan Benedicto
Guest





PostPosted: Wed Jun 22, 2005 1:55 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote

Quote:
I would imagine so, but that is vendor-specific whether the device
actually
does os or not.

Is there a Win32 function to check whether a certain drive exists ?
Don't those sticks just add a "removable" drive to Windows when they
are inserted ?

Thank you,

Jonathan



Back to top
Mike King
Guest





PostPosted: Wed Jun 22, 2005 2:26 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote

Quote:
Is there a Win32 function to check whether a certain drive exists ? Don't
those sticks just add a "removable" drive to Windows when they are
inserted ?

Take a look at the RegisterDeviceNotification function.



Back to top
Jonathan Benedicto
Guest





PostPosted: Wed Jun 22, 2005 2:37 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote

"Mike King" <emailMK (AT) excite (DOT) com> wrote

Quote:
Is there a Win32 function to check whether a certain drive exists ?
Don't those sticks just add a "removable" drive to Windows when
they are inserted ?

Take a look at the RegisterDeviceNotification function.

Thank you for this info.

Jonathan



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Jun 22, 2005 8:39 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote


"Jonathan Benedicto" <incorrect (AT) no (DOT) server> wrote


Quote:
Is there a Win32 function to check whether a certain drive exists ?

There are several ways to do that:

1) GetDriveType().

2) GetFileAttributes/Ex()

3) IShellFolder::ParseDisplayName().

4) Probably several others that I am forgetting right now...

Quote:
Don't those sticks just add a "removable" drive to Windows
when they are inserted ?

I cannot answer that. I have no experience working with memory sticks. I
would imagine that the reader device adds a new drive letter when physically
installed on the machine, so that the drive letter is always available, and
then simply mounts the file system to it when the stick is inserted. That
is how CD/DVD andZip drives work, for instance.


Gambit



Back to top
Jonathan Benedicto
Guest





PostPosted: Wed Jun 22, 2005 8:51 pm    Post subject: Re: Detecting Floppy Disk Media Change. Reply with quote

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote

Quote:
There are several ways to do that:

1) GetDriveType().

2) GetFileAttributes/Ex()

3) IShellFolder::ParseDisplayName().

4) Probably several others that I am forgetting right now...

I cannot answer that. I have no experience working with memory
sticks. I
would imagine that the reader device adds a new drive letter when
physically
installed on the machine, so that the drive letter is always
available, and
then simply mounts the file system to it when the stick is inserted.
That
is how CD/DVD andZip drives work, for instance.

Thank you very much for this info.

Jonathan



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.