Change a name of a file...


    Nov 27 2006 | 9:07 pm
    Hi,
    I'm trying to change a name of a file, but I can't...
    In the doc I found:
    filename (String, get/set)
    The current filename.
    If I have something like:
    (in my path I have a file "zorblug.txt")
    f = new File("zorblug.txt","readwrite");
    f.filename = f.filename + ".turlututu";
    post(f.filename); // I check the new name is right :
    //"zorblug.txt.turlututu"
    f.close();
    I have no error, but in my path, my file is already named "zorblug.txt"...
    Why ???...

    • Dec 13 2006 | 3:45 pm
    • Dec 14 2006 | 9:11 am
      Do you have an example ?
    • Jan 11 2007 | 11:58 am
      sorry i have to learn those objects before.
      i can't open the class.
    • Jan 11 2007 | 12:08 pm
      On 11 janv. 07, at 12:58, fp wrote:
      >
      > sorry i have to learn those objects before.
      > i can't open the class.
      you need to compile the java file first, I'll send you the classes
      privately.
      _____________________________
      Patrick Delges
      Centre de Recherches et de Formation Musicales de Wallonie asbl
    • Jun 17 2009 | 7:43 pm
      hello all,
      i also want to change a filename with javascript.
      has somebody found a solution the last 3 years.
      the helpfile says:
      filename (String, get/set)
      The current filename.
      so i tryed:
      f = new File( theFilePath, "readwrite" );
      f.filename = "my_new_file.mov";
      f.close ();
      i know, that this can be done with an external, java or shell command. but in my case it would be realy complicated ....