• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

renames existing folders during run time

Is there any ways that I can renames existing folders during run time?

For example:
While the program that I am working on needs to create hdr files (base on File1, File2 and File3) under “Folder_four” dir and rename “Folder_four” dir and “Folder_three” dir during run time.

Folder_one
   Folder_two
      Folder_three ß need to change
         Folder_four  ß need to change
      Subfolder_one
            File1
      Subfolder_two
            File2
      Subfolder_three
            File3
      

0
dkim18
Asked:
dkim18
  • 3
  • 2
1 Solution
 
zzynxSoftware engineerCommented:
use File.renameTo(File other)
0
 
zzynxSoftware engineerCommented:
0
 
NaeemgCommented:
use this code. if folder does not exist then u 've to create, if ur folder already exist then omit line 2.

    File oldFolder = new File("c:\\Folder_three");
    oldFolder.mkdir();
    File newFolder = new File("c:\\Folder_three_Renamed");
    oldFolder.renameTo(newFolder);
0
 
NaeemgCommented:
well, I thought answered posted before me is not more precisely to asker. so i posted detailed code that may help asker in sophisticated way.
0
 
zzynxSoftware engineerCommented:
Thanks for accepting
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now