Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ncopy

&pagelevel(3)&pagelevel

Note on usage

Function: Synchronous file transfer

User group: FT user

Alias name: ftscopy

Functional description

The ncopy command is used to issue synchronous requests for sending one or several files or directories to a remote system or for fetching a file or a directory from a remote system or for executing an operating system command in the local or remote system. The ncopy command is executed even if the asynchronous openFT server has not been started.

Instead of a local file, you can also use standard input (stdin) when sending a file, and standard output (stdout) when receiving a file.

If openFT rejects your request, an error message will be displayed explaining why it was rejected (see chapter “Messages”).

openFT transfers the file synchronously to the user process or executes the remote command.

Notes on transferring multiple files

  • For the openFT protocol and the FTP protocol applies: Only one file can be fetched from a remote system for each ncopy command (without -d option). If you want to fetch several files synchronously, use the ft_mget command.

  • For the FTAM protocol applies: It is also possible to fetch or send multiple files for each ncopy command. This is controlled via using a file name starting with two commas. Please refer to the openFT manual "Concepts and Functions", section "Special points for file transfer with FTAM partners" for details.

Status message

openFT displays a status message while file transfer is in progress. The syntax of this message is as follows:

bKB [p%; [hh:]mm:ss]

The variables are:

b

Number of bytes (in KB) already transferred

p

Percentage of file already transferred

hh:mm:ss

estimated time to completion of transfer in hours, minutes and seconds. The hours are not displayed unless the time to completion is longer than sixty minutes. If the size of a file for a receive request is unknown, only the counter for the number of bytes transferred is active.

The status message is updated every three seconds. The first message does not include the anticipated time to completion of transfer. You receive status information only if

  • the file is correspondingly large,

  • the -S or -s switch was not set to suppress messages,

  • the request is not running as a background process (ncopy .... &, only on Unix systems),

  • the standard error output (stderr) is not redirected to a file,

  • a file was specified as source file or the data was input via a pipe (dash (-) for source file), i.e. not input via keyboard.

If the size of the send file is unknown, the status message merely shows the number of bytes already transferred. This is the case if the data is input via a pipe or when a file is received.

When the transfer has been successfully completed, openFT outputs a result message on the screen (stderr) of the user with the following format:

ncopy: request request ID. File file name transferred (without -d option)

ncopy: request request ID. Directory directory name transferred (with -d option)

If openFT was not able to execute your request successfully, an error message will be displayed on the screen (see chapter “Messages”).

A number of special considerations apply for transfer requests with FTP partners. See the section “Notes on FTP partners”.

Format

ncopy -h |

[ -t | -u | -b ][ -x ]
[ -o | -e | -n ]
[ -k | -z ][ -c ][ -S | -s ] [ -m=n | -m=f | -m=a ] *)
[ -d ]
[ <file name 1..512>   [<file name 1..512>...<file name 1..512>] | -

<partner 1..200>![<file name 1..512> | <prefix 0..511>%] ] |

[ <partner 1..200>![<file name 1..512>]

<file name 1..512> | <prefix 0..511>% | - ]

[ <transfer admission 8..67> | @n | @d |
<user ID 1..67> [,[<account 1..64>] [,[<password 1..64>]]] ][ -p=[<password 1..64>] ][ -di ]
[ -lc=<CCS name 1..8> ][ -rc=<CCS name 1..8> ][ -rs=<follow-up processing 1..1000> ]
[ -rf=<follow-up processing 1..1000> ]
[ -r=v[<1..65535>] | -r=f[<1..65535>] | -r=u[<1..65535>] |-r=<1..65535> ]
[ -tff=b | -tff=s ][ -trf=u ]
[ -tb=n | -tb=f | -tb=a ]
[ -av=i | -av=d ] [ -ac=<new account 1..64> ]
[ -am=[r][i][p][x][e][a][c][d] | -am=@rw | -am=@ro ] [ -lq=<legal qualification 1..80> ]
[ -cp=[<password 1..64>] ]
[ -fnc=t | -fnc=c ][ -md ]

*)The option -m is only available on Unix systems.

Description

-h

Displays the command syntax on the screen. Entries after the -h are ignored.

[ -t | -u | -b ][ -x ]

Identifies the type of file in the local system.

If you send a file to an FTAM partner without specifying a file type, the file type is determined by the structure entries of the send file. The structure entries can be displayed by outputting the local openFT attributes (ftshwf file name -l). If there are no structure entries, the default value is -t. If you fetch a file from an FTAM partner without specifying a file type, the file type is determined by the file attributes in the FTAM partner. For more detailed information about file types when dealing with FTAM partners, see the section “FTAM diagnostic codes as per ISO 8571-3”.

-t (default value with openFT partners)

The file contains text with variable-length records.

Records end with the linefeed character \n on Unix systems.

On Windows systems, records end with the following characters:

  • CRLF (X'0D0A') when sending and/or fetching a file

  • LF (X'0A'), only possible when sending a file

Maximum record length = 32767 bytes.

-u

The file contains binary data with variable record length structured by the user. Each record starts with 2 bytes which contain the length data for the record.

-b

The file contains user-structured binary data with variable-length records.

-x

The send file is transferred in a transparent file format and is stored in the destination system, i.e. this is a file whose attributes are transparent for the local system.
The local system here acts as a storage and/or transport medium.

If a file is transparently retrieved with -x for local buffering, then it must be sent again to the remote system in binary form (i.e. with -b).

-o | -e | -n

Indicates whether a destination file is to be newly created, overwritten or extended.

-o (default value)

The destination file will be overwritten or newly created if it does not already exist.

In case of directory transfer (-d option), the target files are overwritten if the specified directory and the files in this directory already exist. Otherwise, the target directory, subdirectories (if they may exist) and the files are newly created. Files and subdirectories which only exist in the target directory remain unchanged.

-e

The transferred file will be appended to an existing destination file. If this destination file does not exist, it will be newly created.

-e is not permitted in case of directory transfer (-d option).

-n

The destination file will be newly created and written. If the destination file already exists, the request will be rejected. In this way, you can protect a file from being overwritten inadvertently.

In case of directory transfer (-d option), the target directory and the files are newly created. If the target directory already exists, the request is rejected.

-k

Indicates that identical characters repeated consecutively are to be transferred in compressed form (byte compression). In the case of connections to partners which do not support this type of compression, no compression is used automatically.

-z

Indicates that zip compression is used. In the case of connections to partners which do not support this type of compression, byte compression (corresponds to the option -k) or no compression are used automatically.

-c

Indicates that the transfer data are encrypted during file transfer. Encryption of the request description data is not affected by this option. If the partner system does not support data encryption, the request is rejected.

[ -S | -s ]

Suppresses file transfer messages to stderr.

-S

All messages are suppressed.

-s

The status message and the end messages are suppressed; error messages are output.

-m=n | -m=f | -m=a (only on Unix systems)

This indicates whether the result message is to be deposited in the mail box of the user who issued the request.

n (default value)

The result message is not deposited in the mailbox.

f

The result message is only deposited in the mailbox in the event of errors.

a

The result message is always deposited in the mailbox.

-d

indicates a directory transfer.

Local and remote file names are interpreted as directory names.

-d is only supported for openFT partners (not for FTAM or FTP partners). Preprocessing and postprocessing are not supported.

If you are using the -d option together with other options (e.g overwrite (-o) or follow-up processing (-rs,...)) then these options apply to the individual files in the directory to be transferred.

file name1 [file name2.. [file name]] | - partner![file name | [prefix]%] |

partner![file name] file name | - | [prefix]%

specifies the source and destination. The syntax depends on the direction of transfer selected and whether pre- or postprocessing commands are used or whether a directory is transferred. The character "-" (hyphen) stands for the standard input or output (stdin/stdout).

If you are using the option -d (directory transfer) then the source and destination file name are considered as directory names.

Sending without pre/postprocessing

Sending a file

Source

Destination

local file1 [ local file2 ..] | -

partner![remote file | [prefix]%]

Sending directories

Source

Destination

local directory name1
[local directory name2 ..]

partner! remote directoy name

If you transfer one or more directories (-d) then you specify the directories you want to transfer in local directory name1, local diretory name2 .... For remote directory name, you specify the directory under which the transferred directories are stored with identical file names and subdirectory names if applicable. The specification for the remote directory may not be omitted.

Fetching without pre/postprocessing

Fetching a file

Source

Destination

partner![remote file]

local file | - | [prefix]%

Fetching a directory

Source

Destination

partner![remote directory name]

local directory name | [prefix]%

Sending and fetching a file with pre- or postprocessing

If you want to perform pre- or postprocessing, then you must enter an operating system command instead of the local or remote file name (in the syntax of the corresponding system):

Sending with preprocessing

Source

Destination

"| local command"

Partner![remote file ]

Sending with postprocessing

Source

Destination

local file1 [ local file2 ..] | -

Partner!"| remote command"

Fetching with preprocessing

Source

Destination

Partner!"| remote command"

local file | - 1)

1)- stands for the standard output

Fetching with postprocessing

Source

Destination

Partner![remote file]

"| local command"

You can also combine preprocessing and postprocessing in the same request.

A maximum of 712 bytes may be specified for source and destination (maximum 512 bytes for the file name and maximum 200 for the partner). Please note that the maximum lengths of file names are system-dependent; for example, in Unix systems it is 512 and in Windows systems a maximum of 256 bytes (for the representation in UTF-8, see section “Entering commands”).

local file1 [local file2 ..] local directory name1 [local directory name2]

Sending: The name(s) of the local file(s) or directory(s) have to be entered here. If you send several files, you have either to specify %, %BASENAME or %FILENAME for the remote file name, see below, or you specify one remote file name and use option -e. With -e, the transferred files are concatenated and written in the specified remote file.

The specification of UNC names is also possible.

Wildcards

If you wish to send several files to a remote system and the files should have the same names in the remote system, you may use wildcards. Do this using the asterisk (*) commonly used for example. The file name must not contain exclamation marks (!). If you specify commands for follow-up processing, follow-up processing is carried out for each file.

If you want to send diretories to the remote system you can use wildcards too.

Note on Windows systems

If you call the ncopy() function from the DLL ncpdll32.dll from a program, you can only specify a filename. Wildcards and prefixes are not supported.

Fetching: Enter the name of the receive file or the local directory (-d option).

The name may be an absolute or relative path name.

If the name ends with %unique or %UNIQUE, this string is replaced by a string which changes for each new call, see section “Entering commands”.

If the directory in the specified path name does not yet exist the following applies:

  • in case of transferring a file the directory is not created

  • in case of transferring a directory the directory is always created

- (dash) for local file

Sending: The dash for local file stands for standard input stdin.

You can also enter data directly via keyboard, in which case you send the ncopy command with a dash for the local file, before processing to enter data.

You terminate entry by pressing the following keys:

<END> or CTRL+D (Unix systems)

CTRL+Z at the start of a line, followed by Return (Windows systems).

See Examples for more details.

Fetching: The dash stands for standard output stdout. The dash directs output to the screen.

Note

  • The dash is only allowed for transferring individual files but not with option -d.

  • On Unix systems apply: You can use the dash if you want to link the ncopy output with a command on the Unix system, see Examples for more details.

[prefix]% for local file

Fetching files: For the receive file name, you may specify %, %BASENAME, %FILENAME or, in addition, a prefix. These variables are substituted as follows:

% and %BASENAME

are substituted by the last part of the name of the remote file. The last part of the name starts after the slash (/) or backslash (\), or a corresponding character in the remote system.

%FILENAME

is overwritten by the full name of the remote file specified in the command.

prefix

You may also specify a prefix for the local file name, e.g. save.%FILENAME. This prefix must end with a dot (.), a slash (/) or a backslash (\).

Fetching directories: When you specify %, %BASENAME or %FILENAME, the name and the structure of the fetched directory are taken over. The specification of prefix% acts analogously as for fetching files.

remote fileremote directory name

remote file and remote directory name can be either absolute or relative to the remote transfer admission (when sending or fetching). If the name in the remote system has been predefined in an admission profile, it must not be specified here.

If the name contains blanks, they must be enclosed in double quotes (e.g. "file name").

If the partner system is running openFT (BS2000), elements from PLAM libraries may also be specified here (syntax: Libname/Element type/Element name).

If the name ends with %unique or %UNIQUE, this string is replaced by a string which changes for each new call, see section “Entering commands”.

If the file name of a receive request starts with an pipe character ("|"), the file name is executed on the remote system as a command if the remote system supports the preprocessing function.

[prefix]% for remote file or remote directory name

Sending files: If you are sending several files, you have to specify %, %BASENAME, %FILENAME for the remote file name. In addition, you can specify a prefix. These variables are substituted as follows:

% and %BASENAME

are substituted by the last part of the name of the send file. The last part of the name starts after the slash (/) or backslash (\), or a corresponding character in the send system.

Please note that when you use % and %BASENAME with wildcards, files with the same names can be produced during substitution and that these are mutually overwritten.

Example

Unix systems:

ncopy file/test1.c test/test1.c\
      partner!destination/% transadm

Windows systems:

ncopy file\test1.c test\test1.c
        partner!destination\% transadm

Both files are copied to destination / test1.c and destination \ test1.c, respectively.

%FILENAME

is overwritten by the full name of the send file specified in the command.

prefix

You may also specify a prefix for the remote file name. This name must end with a dot (.), a slash (/) or a backslash (\).

Example

ncopy *.c *.txt test partner!prob.% profile01

All files which end with .c and .txt and the test file are transferred to the remote system and stored there under the name prob.<local filename>. Here, profile01 is the transfer admission.

Sending directories: When you specify %, %BASENAME, or %FILENAME, the name and the structure of the sended directory(s) are taken over. The specification of prefix% acts analogously as for sending several files.

|command for file name

command is any command on the local or remote system (not permitted in case of directory transfer). The "|" character (vertical bar or pipe character) must always be placed before the command. Since the "|" character is a special character
"|command" should always be enclosed in double quotes.

Please note that, as of openFT V12, pre- or postprocessing commands are converted to the UTF-8 character set in remote Windows systems and that more characters may therefore be required in the remote system, see also section “Entering commands”.

In the case of preprocessing openFT transfers the data output by the command to standard output as a file.

In the case of postprocessing openFT reads the transferred data from the standards input.

In the case of preprocessing, you can also pass the data to the %TEMPFILE variable and, in the case of postprocessing, read the data from the %TEMPFILE variable, see section “Preprocessing and postprocessing”.

If command execution takes longer than ten minutes, a timeout occurs on partners using openFT prior to V8.1 and command execution is regarded as having failed. On partners using openFT V8.1 and later, this restriction no longer applies.

The remote command processing in Unix or Windows systems is starting in the $HOME or Home directory of the user.

Note for Unix systems

The PATH variable is used as follows in the search path for preprocessing and postprocessing commands in Unix systems:

  • Standard instance: :/opt/openFT/bin:/bin:/usr/bin:/opt/bin

  • Other instance: :/var/openFT/instance/openFT/bin:/bin:/usr/bin:/opt/bin where instance is the name of the relevant instance.

This means that the system first searches in the current directory (first ":").

Before calling a "real" preprocessing or postprocessing command you can switch to another directory as follows:

cd path-name;command

path-name is then used as the current directory. There must not be a blank between the semicolon and the command.

Note for local and remote Windows systems

path-name must not be a directory which is addressed using a UNC name. Exception: The UNC checking is deactivated on the system on which the command is to be executed. To do this, the registry value described under https://support.microsoft.com/de-de/kb/156276 has to be generated.

partner

partner is the name of the partner system in the partner list or the address of the partner system. For details on address specifications, see section “Specifying partner addresses”.

transfer admission | @n | @d |

user ID [,[account][,password]]]

In order to be able to send a file to a remote system or to fetch one from it, you must furnish the remote system with proof of identity. For this purpose, you will need login authorization in the syntax valid for the remote system. You can specify this transfer admission

  • as an FTAC transfer admission if FTAC is used in the remote system,

  • or as a login/LOGON authorization in the syntax used by the remote system (user ID, possibly together with account or password).

For details, see section “Entering the authorization data for the partner system”.

@n for transfer admission

By entering @n you specify that the remote system requires no login authorization.

@d for transfer admission

Specifying @d (blanked transfer admission) causes openFT to query the transfer admission on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the transfer admission.

A binary password or binary transfer admission must be specified in hexadecimal format, see section “Entering commands”.

password not specified

Omitting the password necessary for admission causes openFT to query the password on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the password.

Nevertheless, you have to specify the commas, e.g.:

ncopy file partner!file user-id,,

or

ncopy file partner!file user-id,account,

neither transfer admission nor user ID specified

causes the same as @d, i.e. openFT queries the transfer admission on the screen after the command is entered. Your (blanked) entry is always interpreted as transfer admission and not as user ID.

-p=[password]

If the file in the remote system is protected by a write password, you must enter this password when sending a file. If the file is protected by a read password, then this password must be specified when fetching a file from the remote system.

A binary password must be entered in hexadecimal format, see section “Entering commands”. This is of relevance for links to openFT (BS2000), because BS2000 supports the definition of hexadecimal passwords.

password not specified

Specifying -p= causes openFT to query the write or read password on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the password.

-di

is specified, if the data integrity of the transferred file is to be checked by cryptographic means. With it, harmful data manipulations on the transmission network are identified. In case of an error openFT performs an error recovery for asynchronous transfer requests.

If the partner system does not support the check of data integrity (e.g. openFT < V8.1), the request is denied.

For requests with data encryption (option -c), data integrity is automatically checked. Testing mechanisms of the transfer protocols in use automatically identify transfer errors in the network. For this purpose you do not have to specify the -di option.

-lc=CCS name

(local coding) specifies the type of coding (character set) to be used to read or write the local file. CCS name must be known in the local system.

The default value is the character set defined by the FT administrator.

Details about the CCS name and the associated code tables can be found in the manual "openFT (Unix and Windows systems) - Installation and Operation".

-rc=CCS name

(remote coding) specifies the type of coding to be used to read or write the remote file. CCS name must be known in the remote system.

The default value is the character set defined in the remote system by means of XHCS (BS2000 systems) or the openFT operating parameters.

The option -rc is supported only by the openFT protocol and partners with openFT V10.0 or higher. Please note that not all partner systems support all the character sets that are possible in the local system. For details on CCS names and the associated code tables, see the manual "openFT (Unix and Windows systems) - Installation and Operation".

-rs='follow-up processing'

Here you can specify a command in the syntax of the remote system. Following a successful transfer operation, this command is executed in the remote system under the specified login.

Further information is given in the section “Commands for follow-up processing”.

-rf='follow-up processing'

Here you can specify a command in the syntax of the remote system. This command will be executed in the remote system under the specified login if a transfer operation that has already started is cancelled.

Further information is given in the section “Commands for follow-up processing”.


If -d is specified (directory transfer) the follow-up processing is executed for all files in the directory.


-r=v[record length] | -r=f[record length] | -r=u[record length] | -r=record length

indicates the record format and the record length. This also enables records that are longer than the default value to be transferred. However, you must bear in mind that not every record length can be processed in all partner systems.

If you have selected file type b (binary), record length is the value for all records of the send file.

Maximum value: 65535 bytes.

With FTAM partners, the maximum record length specification is not valid unless the file type is set explicitly to t, u or b.

It is also possible to specify the record format, see command ftmodf , option -rf:


v

variable record length, record length determines the maximum value

f

fixed record length, record length then applies to all records

u

undefined record length

The combinations -u -r=frecordlength and -u -r=urecordlength are not permitted.

If -r is omitted then the following default values apply for the record format:


Option

Default value

Corresponds to

-b

u (undefined)

-r=u...

-t

v (variable)

-r=v...

-u

v (variable)

-r=v...


-tff=b | -tff=s

Specifies the format of the destination file.

b

The destination file is to be saved as a block-structured file. This means, for example, that a file can be transferred to BS2000 and stored there as a PAM file. If you specify -tff=b, you must also specify the option -b (binary).

s

The destination file is to be saved as a sequential file and the record format is to be retained. This allows an ISAM file or PAM file to be fetched from BS2000, for instance.

-tff=b must not be specified at the same time as -trf=u.

-trf=u

Specifies that the file is to be transferred as a sequential file and that the record format of the destination file is to be undefined, i.e. any existing record format of the send file is lost. If the file is being transferred to a BS2000 or z/OS system, one block is written per transfer unit.

-trf=u must not be specified at the same time as -tff=b.

Neither -tff nor -trf specified

The destination file is to be stored in the same format as the send file.

-tb=n | -tb=f | -tb=a

Activates/deactivates tabulator expansion and the conversion of blank lines into lines with one character for a single output send request.

The following parameters are provided:

n (on)

Tabulator expansion and blank line conversion are activated.

f (off)

Tabulator expansion and blank line conversion are deactivated.

a (automatic, default value)

Tabulator expansion and blank line conversion are activated if a file is sent to a BS2000, OS/390, or z/OS system.

No tabulator expansion or blank line conversion is performed for outbound receive requests. If ncopy is used as a preprocessing command, then tabulator expansion and blank line conversion are always deactivated.

The following parameters -av, -ac, -am, and -lq are provided exclusively for communication with FTAM partners. openFT thus supports the parameters defined in the FTAM standard. These parameters enable you to define the attributes of the destination file while issuing a file transfer request.

These parameters are ignored for requests involving openFT partners, but the file transfer is still carried out.

-av=i | -av=d

Indicates the availability of the destination file. This parameter can have one of two values: immediate or deferred. A file may be deferred if it has been archived, for example. The partner is responsible for interpreting the term deferred. The FTAM partner conventions must therefore be observed here.

The following values are possible:

i

The destination file attribute is set to immediate.

d

The destination file attribute is set to deferred.

av is not available for requests involving FTAM partners that do not support the storage group. In this case, the request is executed, but the entry for av is ignored.

-av not specified

The availability file attribute is set to a system-specific default value. In this case, this is the value immediate.

-ac=new account

With FTAM partners, this indicates the number of the account to which file storage fees are to be charged. This parameter must be set in accordance with partner system conventions.

ac is not available for requests involving FTAM partners that do not support the storage group. In this case, the request is executed, but the entry for ac is ignored.

-am=[r][i][p][x][e][a][c][d] | -am=@rw | -am=@ro

This sets the access rights of the destination file, provided the security group is available.

The following values can be specified:

r, i, p, x, e, a, c, d, any combination of these values, @rw, or @ro.

r

means that the file can be read.

r not specified

The file cannot be read.

i

means that data units, such as records, can be inserted in the file.

i not specified

No data units can be inserted in the file.

p

means that the file can be overwritten.

p not specified

The file cannot be overwritten.

x

means that data can be appended to the file.

x not specified

The file cannot be extended.

e

means that data units, such as records, can be deleted from the file.

e not specified

No data units can be deleted from the file.

a

means that the file attributes can be read.

a not specified

The file attributes cannot be read.

c

means that the file attributes can be changed.

c not specified

The file attributes cannot be changed.

d

means that the file can be deleted.

d not specified

The file cannot be deleted.

@rw

is the short form of the common access rights read-write (rpxeacd), and thus simplifies input.

@ro

is the short form for the common access rights read-only (rac), and thus simplifies input.

In Unix systems or in BS2000, only the following access rights can be set for a file:


Access
mode

Short
form

Unix
system

BS2000

Access
rights

rpxeacd

@rw

rw*

ACCESS=WRITE

read-write

rac

@ro

r-*

ACCESS=READ

read-only

pxeacd


-w*

only with BASIC-ACL (Access Control List)

write-only

ac


--*

only with BASIC-ACL (Access Control List)

none

* The x bit is not changed by ncopy.


am is not available for requests involving FTAM partners that do not support the security group. In this case, the request is executed, but the entry for am is ignored.

-am not specified

The default values of the FTAM partner system apply.

-lq=legal qualification

This specifies a legal qualification for the destination file (similar to a copyright). This may not exceed 80 characters.

lq is not available for requests involving FTAM partners that do not support the security group. The request is executed, but the entry for lq is ignored.

-cp=[password]

If a password is required in order to create a file on a remote system, this password must be specified here. It can be up to 64 characters long. A binary password must be specified in hexadecimal format, see section “Entering commands”.

If you do not specify a file creation password, but you do enter a file access password for -p=password, the file creation password is identical to the file access password. The file creation password is of no significance when retrieving a file.

password not specified

Specifying -cp= causes openFT to query the file creation password on the screen after the command is entered. Your entry is not displayed to prevent unauthorized persons from seeing the password.

-fnc=t | -fnc=c (file name coding)

specifies the encoding mode for file name and follow-up processing.

t (transparent, default value)

Specification of the remote file name and follow-up processing for the remote system in transparent mode (compatible to the previous versions).

c (character)

Specification of the remote file name and follow-up processing for the remote system in character mode. They are interpreted according to the character code of the remote system, i.e. for Unix partners according to the openFT operating parameter option (ftmodo -fnccs) that has been set there.

-fnc=c is only permitted for openFT partners as of openFT V12.1.

-md (modification date)

The modification date of the send file is taken over for the destination file provided that the destination system supports this. If the destination system does not support this function then the request is rejected.

-md not specified

The behavior is the same as in openFT V11.0 or earlier: On Unix and Windows systems as well as under POSIX (BS2000), the modification date of the send file is taken over. On BS2000 with DMS, the current time is taken over as the modification date.

Examples

  1. The text file airplane is sent to the login name bill with account number a1234ft and password C'pwd' in the BS2000 computer with the partner name bs2r1, where it is to be printed out.

    Local Unix system:

    ncopy airplane bs2r1!% bill,a1234ft,C\'pwd\' \
     -rs="/PRINT-FILE airplane,LAYOUT-CONTROL=*PARAMETERS\
    (,CONTROL-CHARACTERS=EBCDIC)"
    

    Local Windows system:

    ncopy airplane bs2r1!% bill,a1234ft,C'pwd'

      -rs="/PRINT-FILE airplane,LAYOUT-CONTROL=*PARAMETERS

    (,CONTROL-CHARACTERS=EBCDIC)"

  2. A file is to be fetched from BS2000, where openFT-AC is running, to the local Unix or Windows system. The file name has been predefined in an FT profile, which can be accessed with the authorization 'onlyforme'. In the local system the file is to be stored under the name stat.b. It is to be transferred as an unstructured binary stream. The data is to be compressed for file transfer.

    ncopy -b bs2! stat.b 'onlyforme' -k

  3. The text file

    letter is sent to the login name joe with the password pass in the Unix system with the host name xserver. The file should then be printed out in the remote Unix system.

    ncopy letter xserver!letter joe,,pass -rs="lpr letter"

  4. The text file letter is sent to the login name jim with the password jimfun in the FTAM partner with the host name ftampart.

    ncopy letter ftam://ftampart:102.FTAM.FTAM.FTAM!letter jim,,jimfun

    The FT administrator can use ftaddptn to enter the partner in the partner list in order to shorten the command, e.g.

    ftaddptn ftamp1 ftam://ftampart:102.FTAM.FTAM.FTAM

    The ncopy command is then:

    ncopy letter ftamp1!letter jim,,jimfun

  5. The file data is sent from a Windows system pc123 to a Windows system pc234 with the transfer admission topsecret and stored there under the name dat.txt. Then, as follow-up processing, the procedure evaluate is started in the remote system if transferred successfully. The procedure contains the file name dat.txt, the partner pc234 and the message number as parameters. The parameters are specified using variables.

    ncopy data pc234!dat.txt topsecret

       -rs="cmd.exe /c evaluate.bat %FILENAME %PARTNER %RESULT"

  6. The text file locfile is sent to the login name charles with the password secret in the Unix system ux1. There, it is stored under the file name remfile. As follow-up processing, the file is printed if transferred successfully; if not, the prog program is started in the remote system. This program receives the name of the source file and the message number as parameters. The parameters are specified using variables.

    Local Unix system:

    ncopy locfile ux1!remfile charles,,secret -r=100 \
     -rs='lpr remdfile' \
     -rf='prog %FILENAME %RESULT'
    

    Local Windows system:

    ncopy   locfile   ux1!remfile charles ,,secret -r=100

      -rs='lpr remdfile'

      -rf='prog %FILENAME %RESULT'

    If file transfer is not successful, e.g. because the record length was greater than 100 bytes, follow-up processing is executed as follows:

    prog remfile 2210

  7. In the local Unix system, the ls command enables you to view a list of files in a directory on the screen. You want to store this information as a text file in the remote system wx1 and give this file the name unix.dir. The userid is smith and the password any.

    ls | ncopy - wx1!unix.dir smith,,any

  8. Data is sent from the keyboard to the user smith whose computer is wx1 with the password any. The data is stored in the file MEMO.

    ncopy - wx1!memo smith,,any

    Then you enter via the keyboard:

    Will be in headquarters at 4 p.m.

    Regards, Johnson

    You terminate entry by pressing the following keys:

    <END> or CTRL+D (Unix systems)

    CTRL+Z at the start of a line, followed by Return (Windows systems).

    The successful transfer is indicated by the message:

    ncopy: request 65786. File '*STDIN' transferred

  9. This example for Unix systems shows how to bypass the restriction of follow-up processing commands to 1000 characters in total.

    The text file finalreport is sent to the central system ux1 for storage under the login name branch1 with password a-to-z under the file name helpfile. After successful transfer, the file is stored in the directory /home/branch1/file.smith under the file name finalreport, printed out, and appended to the file file.smith. The file file.smith is then sent to the boss's computer bosscomp. In the event of errors, a detailed entry is to be written to the log file errlog in the remote system ux1.

    The restriction is bypassed here by placing the follow-up processing commands in procedures. succproc is the procedure for remote follow-up processing if the transfer is successful, and failproc is the procedure for remote follow-up processing if the transfer fails.

    ncopy finalreport ux1!helpfile branch1,,a-to-z\
     -rs='succproc' \
     -rf='failproc'
    

    If file transfer is successful, the procedure succproc is executed in the remote system under the login name branch1. This contains the following commands:

    cp helpfile /home/branch1/file.smith/finalreport
    lpr -ws=G005 -  pb3 /home/branch1/file.smith/finalreport
    cat helpfile >> /home/branch1/file.smith/file.smith
        ncopy /home/branch1/file.smith/file.smith bosscomp!file.smith \
    secretary,,secret
    rm helpfile
    

    If file transfer is not successful, the procedure failproc is executed in the remote system under the login name branch1. This contains the following commands:

    echo "In the event of an error, a detailed message  " >> errlog
    echo "should be written to the log file.            " >> errlog
    echo "In this case, you can assume that the file    " >> errlog
    echo "transfer failed.                              " >> errlog 
    

    Please note here that the succproc and failproc procedures must be executable (rwx------) in the remote system, or called with sh (e.g. -rs='sh succproc').

  10. The file

    filex on a Windows system is transferred to the user joe in the Windows domain

    dom1.

    ncopy filex system!filex dom1\joe,,passw

  11. Example of specifying UNC names on Windows systems:

    ncopy \\Win01\dir\file ux2!file remoteaccess

  12. Example of the use of preprocessing commands:

    The remote Unix system ux1 possesses a tar archive tar.all under the ID karlotto with the password secret. The file file.1 is to be retrieved from this tar archive into the local

    system and saved in the local file file.loc.

    ncopy ux1!"|ft_tar -xOf tar.all file.1" file.loc \ karlotto,,secret

    ft_tar -xOf retrieves the file from the archive and writes it to stdout. The file file.1 is then therefore not available under the remote ID.

  13. Example of the use of preprocessing commands on a Windows system:

    • All the error messages of the remote file log.txt on the Unix system ux1 are appended to the local file logux1.txt.

      ncopy ux1!"|fgrep ERROR log.txt" logux1.txt geterrorux1 -e

    • The last five log records (return code not equal 0) from the Windows computer Win01 are displayed on the screen.

      ncopy win01!"|ftshwl -nb=5 -rc=@f" - charles,,secret

  14. Example of the use of postprocessing commands on a Unix system:

    The local file file is to be entered in the tar archive tar.all under the name file.x. The tar archive tar.all is located on the remote computer win1 under the transfer admission tarremote. After being entered in the tar archive, the file is to be deleted in the remote system.

    ncopy file win1!"|cp %TEMPFILE file.x;ft_tar -uf tar.all \

          file.x --remove_files" tarremote

  15. Example for illustrating the use of preprocessing and postprocessing commands.

    The local directory dir and all its files are to be transferred to the remote Unix host with the symbolic name ftunix. The current openFT version is also running on the remote host. After the transfer, dir should be available on the remote system under the user ID that owns the copydire transfer admission.

    ncopy "|ft_tar -cf - dir" ftunix!"|ft_tar -xf - " copydire -b

    The dir directory must be located on the local computer in the home directory (on Unix systems: value of the $HOME variable). Please note that no file name prefixes may be defined in the profile.

  16. Example of the use of preprocessing and postprocessing commands on a Unix system:

    At the remote computer ux1, you first want to compress the remote file remfile under the user ID karlotto with the password secret (using the command compress -c remfile). The result is transferred and written to the local system's standard output (-). Here, the output is transferred via a pipe to the uncompress -c command and saved in the local file locfile.

    ncopy -b ux1!"|compress -c remdate" "\

    |uncompress -c>locfile" karlotto,,secret

    If the command is rejected with Remote System: Exitcode 2 in the case of preprocessing/postprocessing then the cause may lie in the remote system's compress command. In some Unix systems, the command supplies return code 2 even though it was successful.

    You can avoid this problem by extending the preprocessing command with 'exit 0':

    ncopy -b ux1!"|compress -c remdate;exit 0" "\

    |uncompress -c>locfile karlotto,,secret

  17. Example for FTP connection on a Unix system:

    In the remote system with the host name wini2 there is only one FTP server. The file all_files under the ID user1 with the password usrpass is to be fetched into the local system. Here, it is to be stored in the directory save_files under the partner-specific name wini2.all_files.

    ncopy ftp://wini2!all_files save_files/%PARTNER.all_files \

    user1,,usrpass

  18. Directory transfer

    The current directory contains two subdirectories. These are to be sent to the Windows system ftwin:

    ncopy -d * ftwin!C:\Software\% smith,,secret

    The remote directory C:\Software must exist. The directories are stored under the directory Software with identical structure and file names. The following message is output after successful transfer:

    ncopy: Requests carried out; 2 Directories transferred