This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes checking for existence of file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "checking for existence of file" Watch "checking for existence of file" New topic

checking for existence of file

jake mullet

Joined: May 09, 2001
Posts: 15
hi friends, if i wanted to check if to see if a file exists in certain directory do i just use the .exists()? for example on a good day there should be only one file in C:\stuff\ called download1.txt, on bad days there are 2 files a download1.txt and download2.txt , so i guess i should just check initially are there 2 files? no then go the first file and do some stuff..any help would be greatly appreciated. thanks JM
Greg Mehlhose

Joined: Jun 05, 2001
Posts: 16

(edited by Cindy to format code)

[This message has been edited by Cindy Glass (edited June 05, 2001).]

Life is short, play hard.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: checking for existence of file
Similar Threads
about pathname.
database(?) and stuff
writing back to jar file ??
Is it possible to write a reg exp to search for files?
JTree - Compare Nodes problem