Re: Search for a file on hard drive?
"Sabari Arasu (CTC)" <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <44669B070CCED611A98600080280774701989E9E@TCS01> |
Hi, this will give the files in C:\\ drive and won't list the files in subfolders. Thanks and Regards, Sabari Arasu _______________________________ TATA Consultancy Services #28, Ambattur Industrial Estate Chennai - 600 058, India Tel : +91 44 2625 6437 _______________________________ > -----Original Message----- > From: Mike Cronin [SMTP:[email protected]] > Sent: Thursday, April 17, 2003 7:01 AM > To: [email protected] > Subject: Re: Search for a file on hard drive? > > Should be as simple as doing the following... > > File file = new File("C:\\"); > String [] files = file.list(); > for (int i=0; i<files.length; i++) { > if (files[i].endsWith(".exe")) { > System.out.println(files[i]); > } > } > > Hope that's what you're looking for. > > Mike > > -----Original Message----- > From: A mailing list for discussion about Sun Microsystem's Java Servlet > API Technology. [mailto:[email protected]] On Behalf Of Ali > Chadorbaf > Sent: Wednesday, April 16, 2003 8:35 AM > To: [email protected] > Subject: Search for a file on hard drive? > > Hi, > Any method available to search for a group of file(e.g : *.exe) on > server and > return the names of those files, if any? > Thanks. > > __________________________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo > http://search.yahoo.com > > ________________________________________________________________________ > ___ > To unsubscribe, send email to [email protected] and include in the > body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > __________________________________________________________________________ > _ > To unsubscribe, send email to [email protected] and include in the > body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html