September 04, 2010, 03:08:09 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Check for file existence  (Read 1203 times)
0 Members and 1 Guest are viewing this topic.
deAppel
Favorite member
Member
*

Reputation: 0
HappyFace plants one on you
Offline Offline
Posts: 45
Referrals: 0

Awards
« on: July 14, 2007, 02:17:14 PM »

Code
GeSHi (java):
  1. import java.io.File;
  2.  
  3.  
  4. /*--------------------------------------------------------------------------
  5. //Author List:
  6. //   deAppel <Creator>
  7. //
  8. //Description:
  9. // Test if a file or directory already exists.
  10. //
  11. //Environment:
  12. //   This software was developed using Eclipse and Java 1.6
  13. //
  14. //Copyright Information:
  15. //   Copyright (C) 2007      <Institution><None>
  16. // Ark de Appel www.engineeringserver.com
  17. //
  18. //----------------------------------------------------------------------*/
  19.  
  20. public class FileExist{
  21.  
  22. public static void main(String[] args){
  23. File f = new File("c:\\WINDOWS");
  24.  
  25. if (f.exists()) {
  26. System.out.println( f.toString() + " exists!");
  27. }
  28. else{
  29. System.out.println("oh nose, something went wrong.");
  30. }
  31.  
  32. }
  33. }
  34.  
Created by GeSHI 1.0.7.20
Logged

Earn $0.04 or more for each search you make! http://www.myhpf.co.uk/apply001.asp?Friend=77889

If you need homework help, just post your assignment and i'll code it before your deadline =) i'll provide you "t3h c0d3z" but only if you show me that you have done something and not just ask for me to write everything for you. Just tell us what the problem is and i'm sure we can fix it for you!

I was born into the Hakka lineage, A bloodline that
traces it's roots back to the original Han emperors of
China. During the rise of the 3 Kingdoms (China's
famous warring period), the Hans were overthrown
and exiled. Forced to flee, they headed south finding
refuge within the mountains of Guilin Province where
they lived under their new title, the Hakka and patiently
wait for their chance to return to the throne as the
Sons Of Heaven...
Javaforums.net :: a community about Java software development.
« on: July 14, 2007, 02:17:14 PM »

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.144 seconds with 32 queries.

Google visited last this page August 30, 2010, 04:27:40 AM