Connection.removeDirectory(options)

Method Description

Removes an empty directory.

Returns

void

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

10 units

Module

N/sftp Module

Since

2019.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.path

String

required

The relative path of a directory to be deleted.

2019.2

Errors

Error Code

Thrown If

FTP_PERMISSION_DENIED

Access to the file or directory on the remote FTP server was denied.

FTP_DIRECTORY_NOT_FOUND

Deleting a directory that does not exist.

FTP_DIRECTORY_NOT_EMPTY

Deleting a directory that is not empty.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/sftp Module Script Samples.

          // Add additional code
...

objConnection.removeDirectory({
    path: 'relative/path/to/remote/dir'
});
...
//Add additional code 

        

Related Topics

General Notices