[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 1

cfxfer Function

Purpose

Checks the status of the programmatic File Transfer.

Library

File Transfer Library (libfxfer.a)

C Syntax

#include <fxfer.h>
cfxfer (sxfer)
struct fxs *sxfer;

Pascal Syntax

%include fxfer.inc
%include fxhfile.inc
function pcfxfer (var Sxfer : fxs) : integer; external;

FORTRAN Syntax

INTEGER FCFXFER
EXTERNAL FCFXFER
CHARACTER*XX SRC, DST, TIME
INTEGER BYTCNT, STAT
INTEGER ERRNO
RC = FCFXFER (SRC, DST, BYTCNT, 
+ STAT, ERRNO, TIME, RC)

Description

The cfxfer function returns the status of the file transfer request made by the fxfer function. This function must be called once for each file transfer request. The cfxfer function places the status in the structure specified by the sxfer parameter for C and Pascal. For FORTRAN, status is placed in each corresponding parameter.

Each individual file transfer and file transfer status completes the requests in the order the requests are made. If multiple asynchronous requests are made:

If the file transfer is run asynchronously and the cfxfer function is immediately called, the function returns a status not available -2 code. An application performing a file transfer should not call the cfxfer function until an error -1 or ready status 0 is returned. The application program can implement the status check in a FOR LOOP or a WHILE LOOP and wait for a -1 or 0 to occur.

C Parameters

sxfer Specifies an fxs structure as defined in the fxfer.h file. The fxs C structure is:
struct fxs  {
    int     fxs_bytcnt;
    char   *fxs_src;
    char   *fxs_dst;
    char   *fxs_ctime;
    int     fxs_stat;
    int     fxs_errno;
}

Pascal Parameters

Sfxfer Specifies a record of type fxs as defined within the fxfer.inc file. The Pascal fxs record format is:
fxs = record
       fxs_bytcnt : integer;
       fxs_src : stringptr;
       fxs_dst : stringptr;
       fxs_ctime : stringptr;
       fxs_stat : integer;
       fxs_errno : integer;
end;

C and Pascal fxs Field Descriptions

fxc_bytcnt Indicates the number of bytes transferred.
fxc_src Points to a static buffer containing the source file name. The static buffer is overwritten by each call.
fxc_dst Points to a static buffer containing the destination file name. The static buffer is overwritten by each call.
fxs_ctime Specifies the time the destination file is created relative to Greenwich Mean Time (GMT) midnight on January 1, 1970.
fxs_stat Specifies the status of the file transfer request.
fxs_errno Specifies the error number that results from an error in a system call.

FORTRAN Parameters

SRC Specifies a character array of XX length containing the source file name.
DST Specifies a character array of XX length containing the destination file name.
BYTCNT Indicates the number of bytes transferred.
STAT Specifies the status of the file transfer request.
ERRNO Specifies the error number that results from an error in a system call.
TIME Specifies the time the destination file is created.

Return Values

The cfxfer function returns the following:

0 Ready status-success. The structure member fxs.fxs_stat contains status of fxfer function.
-1 Error status. Failure of cfxfer function. The fxs structure has NOT been set.
1 Status is not yet available.

The fx_statxxxxxx status file contains the status of each file transfer request made by the application program. The fxfer function fills in the xxxxxx portion of the fx_stat file based on random letter generation and places the file in the $HOME directory.

Examples

For examples of using the cfxfer function see:

Implementation Specifics

The cfxfer function is part of the Host Connection Program (HCON).

Files

$HOME/fx_statxxxxxx Temporary file used for status
/usr/lib/libfxfer.a Library containing C, FORTRAN, and Pascal interface file-transfer functions
/usr/include/fxfer.h C file-transfer include file with structures and definitions
/usr/include/fxfer.inc Pascal file-transfer include file with structure
/usr/include/fxconst.inc Pascal file-transfer function constants
/usr/include/fxhfile.inc Pascal file-transfer invocation include file

Related Information

The fxfer command.

The fxfer function, g32_fxfer function.


[ Previous | Next | Contents | Glossary | Home | Search ]