Change a name of a file…

Nov 27, 2006 at 9:07pm

Change a name of a file…

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

#28917
Dec 13, 2006 at 3:45pm

#89199
Dec 14, 2006 at 9:11am

Do you have an example ?

#89200
Dec 14, 2006 at 11:30am

#89201
Jan 11, 2007 at 11:58am

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

#89202
Jan 11, 2007 at 12:08pm

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

#89203
Jun 17, 2009 at 7:43pm

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

#89204

You must be logged in to reply to this topic.