Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > Java
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 06-21-2006, 07:07 AM   #1 (permalink)
spidermo
Recruit
 
Join Date: Jun 2006
Posts: 14
spidermo is on a distinguished road
Question Help with cd/usb detection

I am trying to find a method to efficiently detect when a cd(or usb flash) is inserted or removed. I would like to use java, but I am finding it difficult to accomplish. So if anybody has any help, it would be appreciated.
-spidermo
__________________
spidermo is offline   Reply With Quote
Old 06-21-2006, 03:04 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
I think you're looking for File.listRoots(). Break it out into a Thread that sleeps every other second and checks for new filesystems, alerting the main program when it finds one.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 06-21-2006, 04:07 PM   #3 (permalink)
spidermo
Recruit
 
Join Date: Jun 2006
Posts: 14
spidermo is on a distinguished road
Ok, thanks, I had thought of doing that also, I was just wondering if there was a different way of doing it.
__________________
spidermo is offline   Reply With Quote
Old 06-21-2006, 05:30 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
I haven't had much occasion to need to detect new filesystems, but if I had to, that's where I would start.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Deadlock Detection Program Help... coolsc81 Standard C, C++ 2 10-26-2004 06:14 AM
Flash Player Detection: Is Moock FPI Update Necessary for FP7? verto Graphics & Flash Development 0 09-24-2003 06:56 PM
Burns, AKA BHR, line detection. Pussnuts Standard C, C++ 1 02-12-2003 01:53 AM


All times are GMT -8. The time now is 10:29 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle