FTAM/9000 Programmer's Guide

274 Chapter 7
Managing and Accessing HP FTAM/9000 Files
Gaining Access to FTAM Files
Gaining Access to FTAM Files
After establishing a connection, either select (ft_select()) or create
(ft_create()) a file for further manipulation. You must always select a file
before opening it (ft_open()), though the selection automatically occurs if
you create the file.
After performing FTAM operations, close (ft_close()) the file and then
deselect (ft_deselect()) or delete (ft_delete()) it. The file remains intact if
you deselect it; if you delete the file, it no longer exists.
ft_create()
#include %</opt/ftam/include/map.h>
#include %</opt/ftam/include/mapftam.h>
Return code
ft_create (connection_id, filename, contents_type,
requested_access, file_status, return_event_name,
input_dcb, inout_dcb)
Connection_id connection_id;
Ft_filename filename;
struct Ft_contents_type contents_type;
Ft_file_actions requested_access;
enum Ft_file_status file_status;
Local_event_name return_event_name;
struct Ft_create_in_dcb *input_dcb;
struct Ft_create_out_dcb **inout_dcb;
Use ft_create() to create a new file. If successful, ft_create()
automatically selects the file.
Invoke ft_create() in the FTAM regime to move to the File Selection
regime.
During ft_connect(), you must negotiate the FT_FU_LTD_MGMT
functional_units to use ft_create().
If the file already exists, the file_status parameter determines
whether a new file is created or the request fails. (Refer to the
“Ft_file_status” section in the “FTAM Data Structures” chapter for
options on setting this field.)