TouchFile

Summary

The TouchFile command creates an empty, zero byte file on Connect’s SFTP server filesystem. If the file given in the input parameter already exists, the command updates the modify time on the file.

Syntax

TouchFile([FilePath=<path to file>]
[, Directory=<directory>]
[, Filter=<wildcard filter>]
[, Regex=<regular expression>])

FilePath can contain the file name and also any parent directories. If the directories or file do not exist, TouchFile creates them.

Use Directory with the Filter or Regex parameters if the specific file name is unknown. Connect uses Java syntax for regular expressions.

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.

If the Directory parameter is specified with no other parameters, all files in the directory are touched. If either the Filter orRegex parameter is specified, only files matching the specified expression are touched in the location indicated by the Directory parameter.

The result of the TouchFile function is a status result set indicating the success or failure of file that is attempted to be touched.

Examples

call TouchFile(FilePath='/tmp/foo.csv');

touchfile_01

call TouchFile(Directory='/tmp', Filter='*.csv');

touchfile_02

RelatedFunctions

DirList

Exists