Multiple files transferred to NAS file share path with the ability to create files and sub-folders XCOM for Windows
search cancel

Multiple files transferred to NAS file share path with the ability to create files and sub-folders XCOM for Windows

book

Article ID: 196324

calendar_today

Updated On:

Products

XCOM Data Transport XCOM Data Transport - Windows

Issue/Introduction

We are trying to copy all the files / sub-folders from a local directory to a NAS path.
The command executed is:
xcomtcp -c1 -f REMOTE_SYSTEM=$Server_IP PORT=8045 LOCAL_FILE=$localfolder REMOTE_FILE=$remotefile USERID=$lanid PASSWORD=$password FILE_OPTION=APPEND PROTOCOL=TCPIP SECURE_SOCKET=YES QUEUE=NO XTRACE=10

$localfolder = “E:\CA\XCOM\Config\HelpFiles\*”
$remotefile = “\\NAS\001_001$\testcopy\*” 

Note: “testcopy” folder already exists on destination, as this will be the given path to the destination zone.
Have already tested setting FILE_OPTION as APPEND, CREATE, REPLACE with no luck.
What's the best option to APPEND if the file/sub-folder is already present on destination and if not CREATE a file / sub-folder during file transfer?

Environment

XCOM™ Data Transport® for Windows

Resolution

Using FILE_OPTION=REPLACE should satisfy the requirements.

If the XCOM.GLB parameter on remote partner receiving the files is set to "CREATE_DIRECTORIES=YES" (the default value) and the local initiating system is sending:
===
$localfolder = “E:\CA\XCOM\Config\HelpFiles\*”

$remotefile = “\\NAS\001_001$\testcopy\*” 
FILE_OPTION=REPLACE
===
then:

  • All files, not sub-folders, from "E:\CA\XCOM\Config\HelpFiles\* will be transferred to and reside under the directory "\\NAS\001_001$\testcopy\".
  • If directory testcopy is not present, it will be created.

Additional Information

FILE_OPTION
Indicates how the transferred data is to be processed by the receiving system. For file transfers only.

  • For general transfers, the range of values is as follows:
    CREATE
       Create a new file on the receiving system.
    APPEND
       Append the transferred data to an existing file on the receiving system.
    REPLACE
       Replace an existing file on the receiving system.
  • For library-type transfers, the range of values is as follows:
    CREATE For systems supporting directories:
    If the directory does not exist, the reaction depends on the value of
    CREATE_DIRECTORIES in the global file, as follows:
       If CREATE_DIRECTORIES=YES, the transfer creates the directory and adds the transferred members.  
       If CREATE_DIRECTORIES=NO, the transfer fails.
    ADD/APPEND For systems supporting directories:
    The value of CREATE_DIRECTORIES determines the outcome of the transfer on the remote system, as 
    follows:
       If CREATE_DIRECTORIES=YES and the directory does not exist, then the directory is created and the transfer members are added to this directory. If the directory does exist, the transfer members are added to this existing directory.
       If CREATE_DIRECTORIES=NO and the directory does not exist, then the transfer fails. If the directory does exist, then the transfer adds the transfer members to the directory.
    REPLACE
    Adds or replaces transferred members. If the directory does not exist, the reaction
    depends on the value of CREATE_DIRECTORIES in the global file, as follows:
       If CREATE_DIRECTORIES=YES, the transfer creates the directory and adds the transferred members.
       If CREATE_DIRECTORIES=NO, the transfer fails.

Note: SUSPEND and RESUME are not supported for those transfers that are transferring multiple files with the use of the * wildcard character. 
=====

The above information is from XCOM for Windows documentation pages for FILE_OPTION and CREATE_DIRECTORIES 
XCOM DATA TRANSPORT FOR WINDOWS 11.6 SERVICE PACKS > Reference > List of Parameters > FILE_OPTION
XCOM DATA TRANSPORT FOR WINDOWS 11.6 SERVICE PACKS > Reference > List of Parameters > CREATE_DIRECTORIES

XCOM DATA TRANSPORT FOR WINDOWS 12.0 > Reference > List of Parameters > FILE_OPTION
XCOM DATA TRANSPORT FOR WINDOWS 12.0 > Reference > List of Parameters > CREATE_DIRECTORIES