Back

RenameFile

JS Py
Hello World

Renames a file on the local filesystem.

app.RenameFile( source, destination )

This method can also be used to move a file to a whole other destination.

See Also: WriteFile, CopyFile, DeleteFile

Example - Example

function OnStart()
{
    var oldfile = "test.txt";
    var newfile = "test2.txt";
    app.WriteFile( oldfile, "Created: " + new Date() );
    app.RenameFile( oldfile, newfile );
}
from native import app

def OnStart():
    oldfile = "test.txt"
    newfile = "test2.txt"
    app.WriteFile(oldfile, "Created: " + str(app.Date()))
    app.RenameFile(oldfile, newfile)
    Copy     Copy All       Run      
String: path to file or folder ( “/absolute/...” or “relative/...” )