moving a folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ioshonowo
    New Member
    • Sep 2007
    • 31

    #1

    moving a folder

    Hello all.

    Could anyone pls tell me which command I can use to move one folder to another location.

    Thanks.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by ioshonowo
    Hello all.

    Could anyone pls tell me which command I can use to move one folder to another location.

    Thanks.
    Command? If you mean how to do it in Java, you can try the platform dependant File.renameTo method. It's probably best to just write a copyFile method, use that and delete the source file after that.

    Comment

    • ioshonowo
      New Member
      • Sep 2007
      • 31

      #3
      Hello all. I have some code now but I am stuck. I am trying to create a file in a completely new path. Here is how I tried

      [code:java]
      fCopy=new File("//10.10.0.127/c$/Documents and Settings/oshonowo/My Documents/Chams Burnt By Branch/Test/Branch"+
      sol_no +"/"+ newFolder +"/perso.txt");
      fCopy.createNew File();
      [/code]

      I cannot create the file using this function. Is there some other function I could use?

      Comment

      • ioshonowo
        New Member
        • Sep 2007
        • 31

        #4
        someone please reply.

        Comment

        • ioshonowo
          New Member
          • Sep 2007
          • 31

          #5
          Let me rephrase the question. Is it possible to create a path as well as a file?

          Comment

          Working...