move

move

Moves a file from one location to another.

Method of

File object

Syntax

int move( FileSpecObject source, FileSpecObject dest );

Parameters

The move method has the following parameters:

source
A FileSpecObject representing the source file.
dest
A FileSpecObject representing the target directory.

Returns

An integer error code. For a list of possible values, see Return Codes.

Description

You must create a FileSpecObject for the destination directory to pass in for this function. If the destination doesn't already exist a file name for the destination is assumed.

Example

source = getFolder("Program", "file.txt");
dest = getFolder("Chrome");
err = File.move(source, dest);

Document Tags and Contributors

 Contributors to this page: Sheppy, ethertank, trevorh, Fredchat, Rod Whiteley
 Last updated by: Sheppy,