MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla
Your Search Results

    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, Fredchat, ethertank, trevorh, Rod Whiteley
    Last updated by: Sheppy,
    Hide Sidebar