Skip to main content

File

A Volume may contain one or more files. Files and folders are both considered to belong to the File class.

Table 1, “File type table lists enums used by FCREPLFileType.

Table 1. File type table

Symbolic

Code

Description

FCREPL_INVALID

-1

File is invalid.

FCREPL_CTREE

0

File is c-tree.

FCREPL_CTREE_CORRUPT

1

File is c-tree but it is corrupted.

FCREPL_CTREP_QUALIF

2

File is c-tree and qualifies for replication.

FCREPL_CTREP_QUALIF_RTG

3

File is c-tree and qualifies for replication.

FCREPL_CTREP_NO_IFIL

4

File is c-tree but does not have IFIL so it does not qualify for replication.

FCREPL_CTREP_NO_TRNLOG

5

File is c-tree but is not TRNLOG so it does not qualify for replication.

FCREPL_CTREP_NO_IDX

6

File is c-tree but doe not have an index that qualifies for replication.

FCREPL_CTREP_NO_XHEADER

7

File does not support extended header created before V7.

FCREPL_PENDING

8

File is pending on the schema checked - likely due to a permission issue.

FCREPL_CTREEIDX

9

File is a c-tree index.

FCREPL_DIR

10

File is a FairCom super file.

FCREPL_DIR

11

Item is a directory.

FCREPL_NCTREE

12

This is not a c-tree file.

FCREPL_CTREP_FTI

13

File is c-tree but has a full-text index so it does not qualify for replication.



Class

FCREPLFile

It represents a physical file, table, or directory from the file system and from the database (FCREPLDatabase).

Getters

Table 2. Getters

File type

FCREPLFileType GetType() { return (FCREPLFileType)((pRCESFile)this)->GetType(); };



Inherited getters

Table 3. Inherited getters

Return if the object is for a c-tree file

bool IsCtree();

File identification

int GetID();

File volume identification

Note

This is linked to the FCREPLVolume class.

int GetVolumeID();

File path

const char *GetPath();

Filename

const char *GetName();

Table name

Note

In case it is part of a database.

const char *GetTable();

File size on disk

RCESSize GetSize();

File creation time

RCESDateTime GetCreateTime();

File update time

RCESDateTime GetUpdateTime();

Return if the file is a directory

bool GetIsDir();

Return if the file is a c-tree partitioned file

bool GetIsPartitioned();

Return the type

RCESFileType GetType();

Return if the file is replicated

bool GetIsReplicated();

Database identification

Note

It is linked to the FCREPLDatabase class.

int GetDatabaseID();

File volume name

const char *GetVolumeName();

Return Rel file ID

int GetRelFileID();



Setters

Table 4. Setters

File type

void SetType(FCREPLFileType type) { ((pRCESFile)this)->SetType((RCESFileType)type); };

File path

void SetPath(const char *path) { ((pRCESFile)this)->SetPath(path); };

Filename

void SetName(const char *name) { ((pRCESFile)this)->SetName(name); };

Table name

Note

In case it is part of a database.

void SetTable(const char *table) { ((pRCESFile)this)->SetTable(table); };



Inherited setters

Table 5. Inherited setters

File identification

void SetID(int fileID);

File volume identification

Note

This is linked to FCREPLVolume class,

void SetVolumeID(int volumeID);

Path

void SetPath(const char *path);

Name

void SetName(const char *name);

Table

void SetTable(const char *table);

File size on disk

void SetSize(RCESSize size);

File creation time

void SetCreateTime(RCESDateTime createTime);

File update time

void SetUpdateTime(RCESDateTime updateTime);

Set if the file is a directory

void SetIsDir(bool isDir);

Set if the file is a c-tree partitioned file

void SetIsPartitioned(bool isPartitioned);

Type

void SetType(RCESFileType type);

Set if the file is replicated

void SetIsReplicated(bool isReplicated);

Database identification

Note

It is linked to the FCREPLDatabase class.

void SetDatabaseID(int databaseID);

Volume name

void SetVolumeName(const char *volumeName);

Rel file ID

void SetRelFileID(int relFileID) { _relFileID = relFileID; };



Recursively scan all the files under the given rootTreePath filtered by a given maskFilter using the given configFileName and populate both VOLUME and FILE tables.

Prototype

FCREPL_API int fcReplLoadFiles(pFCREPLConn replConn, int volumeID, const char *rootTreePath, const char *maskFilter, bool ctreeOnly, bool recursive, bool physicalCheck, bool wait, int *actionID);

Parameters

Table 6. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

volumeID [IN]

Volume identification to be monitored

rootTreePath [IN]

Local path to be monitored — for example, "C:\path" or "/home/path"

maskFilter [IN]

File/Dir mask to be monitored (supported multiple masks delimited by [;] — for example,  "*.dat;*.txt;*.rpo")

ctreeOnly [IN]

Flag indicating that we should scan only for c-tree data files

recursive [IN]

Flag indicating whether to scan from root recursively or not

physicalCheck [IN]

Check if the files in FileTable physically exist

wait [IN]

Flag indicating to wait for the scan to terminate or run it asynchronous

actionID [OUT]

Action identification for the FS load action



Return

Error code

Retrieve the list of files from a given root tree. It can be called several times if necessary to retrieve all the blocks of files.

Prototype

FCREPL_API int fcReplGetFiles(pFCREPLConn replConn, int volumeID, const char *rootTreePath, const char *mask, bool recursive, bool physicalCheck, int checkReplPlan, bool refresh, bool ctreeOnly, int fileListSize, int fileStart, ppFCREPLFile *fileList, int *fileCount, int *totalFiles);

Parameters

Table 7. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

volumeID [IN]

Volume identification

rootTreePath [IN]

Root path

mask [IN]

File mask for the file search

recursive [IN]

Flag indicating if it must also search on children folders

physicalCheck [IN]

Check if the files in FileTable physically exist

checkReplPlan [IN]

replication plan to be checked against the file or -1 if not checked

refresh [IN]

Flag indicating whether to execute a FileSystem scan before returning the files

ctreeOnly [IN]

Flag indicating to scan only for c-tree data files

Note

This is only in case of refresh is TRUE.

fileListSize [IN]

File list count to be retrieved

fileStart [IN]

File list start record

fileList [OUT]

File entity list

fileCount [OUT]

Number of file entities in the list

totalFiles [OUT]

Total number of files entities



Return

  • Error code

  • FCREPL_MORE_RESULT in case of pending files to be read

Retrieve the list of files from a given database ID.

Prototype

FCREPL_API int fcReplGetFiles(pFCREPLConn replConn, int databaseID, int checkReplPlan, int fileListSize, int fileStart, ppFCREPLFile *fileList, int *fileCount, int *totalFiles);

Parameters

Table 8. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

databaseID [IN]

Database identification

checkReplPlan [IN]

replication plan to be checked against the file or -1 if not checked

fileListSize [IN]

File list count to be retrieved

fileStart [IN]

File list start record

fileList [OUT]

File entity list

fileCount [OUT]

Number of file entities in the list

totalFiles [OUT]

Total number of files entities



Return

  • Error code

  • FCREPL_MORE_RESULT in case of pending files to be read

Retrieve the file from a given volume, path, and name.

Prototype

FCREPL_API int fcReplGetFile(pFCREPLConn replConn, int volumeID, const char *path, const char *name, ppFCREPLFile file);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

volumeID [IN]

Volume identification to be monitored

path [IN]

File path

name [IN]

Filename

file [OUT]

Files read from the calling criteria



Return

Error code

Retrieve the file from a given OpSystem and full filename.

Prototype

FCREPL_API int fcReplGetFile(pFCREPLConn replConn, int osID, const char *fullFileName, ppFCREPLFile file);

Parameters

Table 10. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

osID [IN]

OpSystem identification

fullFileName [IN]

Full filename

file [OUT]

Files read from the calling criteria



Return

Error code

Persist a file entity object into the master database

Prototype

FCREPL_API int fcReplPersistFile(pFCREPLConn replConn, pFCREPLFile file);

Parameters

Table 11. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

file [IN]

File entity object



Return

Error code

Remove a file from the master database by its identification.

Prototype

FCREPL_API int fcReplRemoveFile(pFCREPLConn replConn, int fileID, bool recursive);

Parameters

Table 12. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

fileID [IN]

File identification

recursive [IN]

Recursive flag



Return

Error code