Maybe its because you don't use "\\" for "\" in your path string ( escape codes )
 
 
-----Ursprungligt meddelande-----
Fr�n: david [mailto:[EMAIL PROTECTED]]
Skickat: den 20 april 2000 10:08
Till: [EMAIL PROTECTED]
�mne: Renaming file

Hi,
 
I am attaching a code down where I am renaming file. it works fine if  I am not giving the path but when I include path its giving error can somebody help me out  in this
 
David

import java.io.*;

import java.util.*;

public class test

{

public static void main(String args[])

{

try

{

File fil=new File("hello.txt");

if( fil.exists () )

System.out.println( "Exists");

if( fil.renameTo(new File("hello1.txt")) )

System.out.println( "Succeeded");

else

System.out.println( "Failed");

}

catch(Exception e){}

}

}

Reply via email to