Forums > Javascript

Change a name of a file…

November 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 ???…


December 13, 2006 | 3:45 pm


December 14, 2006 | 9:11 am

Do you have an example ?


December 14, 2006 | 11:30 am



FP
January 11, 2007 | 11:58 am

sorry i have to learn those objects before.
i can’t open the class.


January 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

http://users.skynet.be/crfmw/max


June 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 ….


Viewing 7 posts - 1 through 7 (of 7 total)