MoveFile
Summary
Use the MoveFile
function to move a file from one directory to another. All files and directories available via the command are located on Connect’s SFTP server filesystem.
Syntax
MoveFile([FilePath=<path to file>] |
Parameters
Parameter | Description |
---|---|
FilePath | (Optional) String value or expression containing the full Unix-style path name and source file name used to move a single file. If no path is given, the root SFTP directory is assumed. The Directory , Filter , and Regex parameters are ignored when theFilePath is specified. |
Directory | (Optional) String value or expression with a directory name or directory path when moving more than one file. Format is Unix-style. Filter and Regex parameters limit the file names to move and are used in lieu of a filename in FilePath. |
Destination | (Required) The target directory path.The destination is always assumed to be a directory path. You cannot specify the target filename (source filenames will be used to create target file names). Unix-style directory path. The copy command will create any directories if they do not already exist. |
Filter | (Optional) String value containing wildcard search expressions to specify source files to move. Restricts the command to only those files and directories matching the filter expression. |
Regex | (Optional) Use when you require more complicated search patterns. A string value containnig a Java regular expression. |
Overwrite | (Optional) Default is false. If the Overwrite parameter is true , files moved from the source directory overwrite existing files in the destination. When the Overwrite parameter is false , existing files in the destination directory are not overwritten. |
Details
Connect is integrated with Xactly’s SFTP server, connectftp.xactlycorp.com. Connect’s file commands can read and write files and manipulate directory structures located on the SFTP file system. An SFTP account is not required to use these functions. However, one is required to access the file system via SFTP clients. Contact Xactly Customer Support to setup an SFTP account if your business does not already have one.
The result is a status result set indicating whether the directory and intermediates were fully created. The value column of the result set is a boolean true or false.
Examples
call MoveFile(FilePath='/tmp/foo.csv', Destination='/tmp/mytemp');
call MoveFile(Directory='/source_files', Filter='*.csv', Destination='/processed');