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

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");
      System.out.println("Error, unable to rename the file");

Users who found this page were searching for:

  • for loop comma java
  • factorial of number in perl
  • perl factorial function
  • java program to get all gmail inbox
  • perltk opendir
  • how to compare strings in python
  • perl basic programs examples for factorial of number
  • generics in java usb
  • python Qsettings "check if key exists"
  • count number of points python

No comments yet.

Leave a Comment