File Copy Writer

The File Copy writer can copy or move files or folder contents from local or remote file systems to a destination folder. This writer can also delete files or folder contents from local or remote file systems.

Note  When copying and moving, the format of files will remain unchanged. Permissions settings for copy, move, and delete options will be determined by the destination machine operating system and file system location.

Product and System Requirements

Format

FME Platform

Operating System

Reader/Writer

FME Form

FME Flow

FME Flow Hosted

Windows 64-bit

Linux

Mac

Writer

Yes

Yes

Yes

Yes

Yes

Yes

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 are only parsed for the feature type name and specific format attributes that are relevant to the writer. User attributes and geometry are ignored. Each feature type name can provide a subfolder to delete, or copy or move output into the writer dataset.

Format attributes allow for specifying the source files to copy, move, or delete, as well as potentially specific renaming of individual files. Operations can be performed per input feature.

This writer supports three file operation modes: Copy, Move, and Delete:

Copy, Move, Delete

  • Accepts UNC paths, absolute paths, and relative paths (relative to the workspace folder).
  • Supports files, folders, and subfolders.

Copy and Move

  • Copy files or folders, with the option to include or exclude folder contents.
  • Overwrite existing files in the destination folder.
Note  Input features without sufficient information to perform an 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 globbing, 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.