File Copy Writer
The File Copy Writer module provides FME with direct access to copying or moving files or folder contents on local or remote file systems to the destination dataset folder or another user-specified 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 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
- file or folder (contents only) input
- optional copying of subfolders
- overwriting of existing files in the destination folder
Relative paths are with respect to the workspace folder.
Usage Notes
- 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.
- File naming conflicts can be resolved through the Overwrite Existing File parameter, which directs the writer to overwrite the files in the output folder if name collisions occur. Also, if the source location provided is a folder, subfolders and their contents may be optionally copied to the destination location as well.
- Input sources include 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 is 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.
Note: 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.
Writer Overview
The File Copy writer ignores all the contents of the input features except for specific format attributes. A copy operation can be performed per input feature.
Input features without sufficient information to perform a copy or move operation are ignored.