File Copy Writer

The File Copy Writer allows FME to copy or move files or folder contents from local or remote file systems to a destination folder.

The format of these files will remain unchanged; however, the permissions settings will be determined by the destination machine operating system and file system location.

Overview

Source files or folders are provided on individual features sent to the File Copy writer.

The Writer Dataset specifies the destination for the copy.

The features themselves are ignored in terms of user attributes and geometry, and are only parsed for the feature type name and specific format attributes that are relevant to the writer. Each feature type name can provide a subfolder to copy or move output into the writer dataset. Format attributes allow for specifying the source files to copy or move, as well as potentially specific renaming of individually copied files.

This writer supports two file operation modes: Copy and Move. These reflect the corresponding file system calls to copy or move data files, respectively. Both operations support:

  • UNC
  • absolute and relative paths (relative paths are with respect to the workspace folder)
  • file or folder (contents only) input
  • optional copying of subfolders
  • overwriting of existing files in the destination folder

A copy operation can be performed per input feature.

Input features without sufficient information to perform a copy or move operation are ignored.

Usage Notes

Format Attribute filecopy_source_dataset

 

The source data location is specified on each input individual feature to the writer using a format attribute called filecopy_source_dataset.

The destination data location is by default provided by the writer dataset, which must be a folder. Additionally, the feature type name specifies a destination subfolder as a relative path within the writer dataset folder.

When files are copied or moved, by default the original file names are preserved. However, if the format attribute filecopy_source_dataset is a file, then the format attribute filecopy_dest_filename can be used to rename a specific source filename to a new destination filename.

Input Sources

Files and folder names formatted as either relative, absolute, or UNC names, and must be specified using forward slashes (c:/temp/) or escaped backslashes (c:\\temp\\).

Relative paths are with respect to the workspace folder.

Pattern Support

Supported on the input dataset in the form of simplified globing, which is much like regular expressions. Only two characters are supported: asterisk (*) and question mark (?).

For example, an input source of c:/temp/*.txt could match all files with the extension .txt in the c:/temp/ folder, provided that it exists and is accessible according to file system permissions.

WARNING: There is currently no support for progress indication during long copy operations, and canceling a copy operation may result in corrupt output data in the destination folder.

Examples

See examples of file and folder locations.