File
Files for the C++ Replication API
A Volume may contain one or more files. Files and folders are both considered to belong to the File class.
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
.
Symbolic | Code | Description |
---|---|---|
| -1 | File is invalid. |
| 0 | File is c-tree. |
| 1 | File is c-tree but it is corrupted. |
| 2 | File is c-tree and qualifies for replication. |
| 3 | File is c-tree and qualifies for replication. |
| 4 | File is c-tree but does not have |
| 5 | File is c-tree but is not |
| 6 | File is c-tree but doe not have an index that qualifies for replication. |
| 7 | File does not support extended header created before V7. |
| 8 | File is pending on the schema checked - likely due to a permission issue. |
| 9 | File is a c-tree index. |
| 10 | File is a FairCom super file. |
| 11 | Item is a directory. |
| 12 | This is not a c-tree file. |
| 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
File type |
|
Inherited getters
Return if the object is for a c-tree file |
|
File identification |
|
File volume identification NoteThis is linked to the |
|
File path |
|
Filename |
|
Table name NoteIn case it is part of a database. |
|
File size on disk |
|
File creation time |
|
File update time |
|
Return if the file is a directory |
|
Return if the file is a c-tree partitioned file |
|
Return the type |
|
Return if the file is replicated |
|
Database identification NoteIt is linked to the |
|
File volume name |
|
Return |
|
Setters
File type |
|
File path |
|
Filename |
|
Table name NoteIn case it is part of a database. |
|
Inherited setters
File identification |
|
File volume identification NoteThis is linked to |
|
Path |
|
Name |
|
Table |
|
File size on disk |
|
File creation time |
|
File update time |
|
Set if the file is a directory |
|
Set if the file is a c-tree partitioned file |
|
Type |
|
Set if the file is replicated |
|
Database identification NoteIt is linked to the |
|
Volume name |
|
|
|
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
Parameter | Description |
---|---|
| Replication connection handle |
| Volume identification to be monitored |
| Local path to be monitored — for example, |
| File/Dir mask to be monitored (supported multiple masks delimited by [;] — for example, |
| Flag indicating that we should scan only for c-tree data files |
| Flag indicating whether to scan from root recursively or not |
| Check if the files in |
| Flag indicating to wait for the scan to terminate or run it asynchronous |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| Volume identification |
| Root path |
| File mask for the file search |
| Flag indicating if it must also search on children folders |
| Check if the files in |
| replication plan to be checked against the file or -1 if not checked |
| Flag indicating whether to execute a FileSystem scan before returning the files |
| Flag indicating to scan only for c-tree data files NoteThis is only in case of refresh is TRUE. |
| File list count to be retrieved |
| File list start record |
| File entity list |
| Number of file entities in the list |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| Database identification |
| replication plan to be checked against the file or -1 if not checked |
| File list count to be retrieved |
| File list start record |
| File entity list |
| Number of file entities in the list |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| Volume identification to be monitored |
| File path |
| Filename |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| OpSystem identification |
| Full filename |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| 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
Parameter | Description |
---|---|
| Replication connection handle |
| File identification |
| Recursive flag |
Return
Error code