Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to rename file or directory

Java: How to rename file or directory
{filelink=7776}

import java.io.File;
public class Rename_File
 {
  public static void main(String[] argv)
  	{
    File old_name = new File("C:/test.txt");
    File new_name= new File("C:/testTmp.txt");
    if (old_name.renameTo(nouveau_nom))
    {
      System.out.println("The file has been renamed");
    }
    	else
    {
      System.out.println("Error, unable to rename the file");
    }
  }
}

Users who found this page were searching for:

  • perl program to find factorial
  • perltk opendir
  • perl factorial function
  • how to compare strings in python
  • generics in java usb
  • factorial of number in perl
  • count number of points python
  • perl basic programs examples for factorial of number
  • for loop comma java
  • to remove occurrences of a substring in a string using python

No comments yet.

Leave a Comment