Btrieve 2
Loading...
Searching...
No Matches
bfileinformation.py

This is an example of file information use written in Python.

1import sys
2import struct
3import math
4import os
5import platform
6
7if (platform.system() == "Windows"):
8 sys.path.append("C:\\Program Files\\Actian\\Zen\\bin")
9else:
10 sys.path.append("/usr/local/actianzen/lib64")
11
12import btrievePython
13
14# If the incorrect number of arguments were given.
15if (len(sys.argv) != 2):
16 sys.exit("Usage: " + os.path.basename(sys.argv[0]) + " btrieveFileName")
17
18btrieveFileName = sys.argv[1]
19
20btrieveClient = btrievePython.BtrieveClient()
21assert(btrieveClient != None)
22
23btrieveFile = btrievePython.BtrieveFile()
24assert(btrieveFile != None)
25
26# Open file.
27rc = btrieveClient.FileOpen(btrieveFile, btrieveFileName, None, btrievePython.Btrieve.OPEN_MODE_NORMAL)
28assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileOpen():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
29
30# Print file information.
31
32btrieveFileInformation = btrievePython.BtrieveFileInformation()
33assert(btrieveFileInformation != None)
34
35
36
37rc = btrieveFile.GetInformation(btrieveFileInformation)
38assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFile::GetInformation():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
39
40
41
42rc = btrieveFileInformation.GetBalancedIndexes()
43assert(rc >= 0), "Error: BtrieveFileInformation::GetBalancedIndexes():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
44
45print("BalancedIndexes =", "Yes" if rc > 0 else "No")
46
47
48
49rc = btrieveFileInformation.GetClientTransactions()
50assert(rc >= 0), "Error: BtrieveFileInformation::GetClientTransactions():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
51
52print("ClientTransactions =", "Yes" if rc > 0 else "No")
53
54
55
56rc = btrieveFileInformation.GetDuplicateRecordConflictCursorPosition()
57assert(rc >= 0), "Error: BtrieveFileInformation::GetDuplicateRecordConflictCursorPosition():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
58
59print("DuplicateRecordConflictCursorPosition =", rc)
60
61
62
63rc = btrieveFileInformation.GetDuplicateRecordConflictIndex()
64assert(rc != btrievePython.Btrieve.INDEX_UNKNOWN), "Error: BtrieveFileInformation::GetDuplicateRecordConflictIndex():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
65
66print("DuplicateRecordConflictIndex =", btrievePython.Btrieve_IndexToString(rc))
67
68
69
70rc = btrieveFileInformation.GetContinuousOperation()
71assert(rc >= 0), "Error: BtrieveFileInformation::GetContinuousOperation():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
72
73print("ContinuousOperation =", "Yes" if rc > 0 else "No")
74
75
76
77rc = btrieveFileInformation.GetExplicitLocks()
78assert(rc >= 0), "Error: BtrieveFileInformation::GetExplicitLocks():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
79
80print("ExplicitLocks =", "Yes" if rc > 0 else "No")
81
82
83
84rc = btrieveFileInformation.GetFileVersion()
85assert(rc != btrievePython.Btrieve.FILE_VERSION_UNKNOWN), "Error: BtrieveFileInformation::GetFileVersion():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
86
87print("DuplicateRecordConflictIndex =", btrievePython.Btrieve_FileVersionToString(rc))
88
89
90
91rc = btrieveFileInformation.GetFixedRecordLength()
92assert(rc >= 0), "Error: BtrieveFileInformation::GetFixedRecordLength():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
93
94print("FixedRecordLength =", rc)
95
96
97
98rc = btrieveFileInformation.GetFreeSpaceThreshold()
99assert(rc != btrievePython.Btrieve.FREE_SPACE_THRESHOLD_UNKNOWN), "Error: BtrieveFileInformation::GetFreeSpaceThreshold():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
100
101print("FreeSpaceThreshold =", btrievePython.Btrieve_FreeSpaceThresholdToString(rc))
102
103
104
105rc = btrieveFileInformation.GetGatewayMajorVersion()
106assert(rc >= 0), "Error: BtrieveFileInformation::GetGatewayMajorVersion():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
107
108print("GatewayMajorVersion =", rc)
109
110
111
112rc = btrieveFileInformation.GetGatewayMinorVersion()
113assert(rc >= 0), "Error: BtrieveFileInformation::GetGatewayMinorVersion():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
114
115print("GatewayMinorVersion =", rc)
116
117
118
119rc = btrieveFileInformation.GetGatewayName()
120assert(rc != None), "Error: BtrieveFileInformation::GetGatewayName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
121
122print("GatewayName =", rc)
123
124
125
126rc = btrieveFileInformation.GetGatewayPatchLevel()
127assert(rc >= 0), "Error: BtrieveFileInformation::GetGatewayPatchLevel():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
128
129print("GatewayPatchLevel =", rc)
130
131
132
133rc = btrieveFileInformation.GetGatewayPlatform()
134assert(rc >= 0), "Error: BtrieveFileInformation::GetGatewayPlatform():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
135
136print("GatewayPlatform =", rc)
137
138
139
140rc = btrieveFileInformation.GetHandleCount()
141assert(rc >= 0), "Error: BtrieveFileInformation::GetHandleCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
142
143print("HandleCount =", rc)
144
145
146
147rc = btrieveFileInformation.GetIdentifier()
148assert(rc >= 0), "Error: BtrieveFileInformation::GetIdentifier():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
149
150print("Identifier =", rc)
151
152
153
154rc = btrieveFileInformation.GetIndexCount()
155assert(rc >= 0), "Error: BtrieveFileInformation::GetIndexCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
156
157print("IndexCount =", rc)
158
159
160indexCount = rc
161
162
163rc = btrieveFileInformation.GetKeyOnly()
164assert(rc >= 0), "Error: BtrieveFileInformation::GetKeyOnly():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
165
166print("KeyOnly =", "Yes" if rc > 0 else "No")
167
168
169keySegmentNumber = 1
170indexNumber = 0
171
172btrieveKeySegment = btrievePython.BtrieveKeySegment()
173assert(btrieveKeySegment != None)
174
175while (indexNumber < indexCount):
176
177 rc = btrieveFileInformation.GetKeySegment(btrieveKeySegment, keySegmentNumber)
178 assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveFileInformation::GetKeySegment():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))
179
180
181 print("KeySegmentNumber =", keySegmentNumber)
182
183
184 rc = btrieveKeySegment.GetACSMode()
185 assert(rc != btrievePython.Btrieve.ACS_MODE_UNKNOWN), "Error: BtrieveKeySegment::GetACSMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
186
187 print("\tACSMode =", btrievePython.Btrieve_ACSModeToString(rc))
188
189
190
191 rc = btrieveKeySegment.GetACSNumber()
192 assert(rc >= 0), "Error: BtrieveKeySegment::GetACSNumber():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
193
194 print("\tACSNumber =", rc)
195
196
197
198 rc = btrieveKeySegment.GetDataType()
199 assert(rc != btrievePython.Btrieve.DATA_TYPE_UNKNOWN), "Error: BtrieveKeySegment::GetDataType():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
200
201 print("\tDataType =", btrievePython.Btrieve_DataTypeToString(rc))
202
203
204
205 rc = btrieveKeySegment.GetDescendingSortOrder()
206 assert(rc >= 0), "Error: BtrieveKeySegment::GetDescendingSortOrder():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
207
208 print("\tDescendingSortOrder =", "Yes" if rc > 0 else "No")
209
210
211
212 rc = btrieveKeySegment.GetDuplicateMode()
213 assert(rc != btrievePython.Btrieve.DUPLICATE_MODE_UNKNOWN), "Error: BtrieveKeySegment::GetDuplicateMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
214
215 print("\tDuplicateMode =", btrievePython.Btrieve_DuplicateModeToString(rc))
216
217
218
219 rc = btrieveKeySegment.GetIndex()
220 assert(rc != btrievePython.Btrieve.INDEX_UNKNOWN), "Error: BtrieveKeySegment::GetIndex():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
221
222 print("\tIndex =", btrievePython.Btrieve_IndexToString(rc))
223
224
225
226 rc = btrieveKeySegment.GetKeyContinues()
227 assert(rc >= 0), "Error: BtrieveKeySegment::GetKeyContinues():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
228
229 print("\tKeyContinues =", "Yes" if rc > 0 else "No")
230
231
232 if (rc == 0):
233 indexNumber += 1
234
235
236 rc = btrieveKeySegment.GetLength()
237 assert(rc >= 0), "Error: BtrieveKeySegment::GetLength():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
238
239 print("\tLength =", rc)
240
241
242
243 rc = btrieveKeySegment.GetModifiable()
244 assert(rc >= 0), "Error: BtrieveKeySegment::GetModifiable():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
245
246 print("\tModifiable =", "Yes" if rc > 0 else "No")
247
248
249
250 rc = btrieveKeySegment.GetNullKeyMode()
251 assert(rc != btrievePython.Btrieve.NULL_KEY_MODE_UNKNOWN), "Error: BtrieveKeySegment::GetNullKeyMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
252
253 print("\tNullKeyMode =", btrievePython.Btrieve_NullKeyModeToString(rc))
254
255
256
257 rc = btrieveKeySegment.GetNullValue()
258 assert(rc >= 0), "Error: BtrieveKeySegment::GetNullValue():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
259
260 print("\tNullValue =", rc)
261
262
263
264 rc = btrieveKeySegment.GetOffset()
265 assert(rc >= 0), "Error: BtrieveKeySegment::GetOffset():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
266
267 print("\tOffset =", rc)
268
269
270
271 rc = btrieveKeySegment.GetUniqueValueCount()
272 assert(rc >= 0), "Error: BtrieveKeySegment::GetUniqueValueCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveKeySegment.GetLastStatusCode()))
273
274 print("\tUniqueValueCount =", rc)
275
276
277 keySegmentNumber += 1
278
279
280rc = btrieveFileInformation.GetLockOwnerClientIdentifier()
281assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerClientIdentifier():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
282
283print("LockOwnerClientIdentifier =", rc)
284
285
286
287rc = btrieveFileInformation.GetLockOwnerExplicitLockMode()
288assert(rc != btrievePython.Btrieve.LOCK_MODE_UNKNOWN), "Error: BtrieveFileInformation::GetLockOwnerExplicitLockMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
289
290print("LockOwnerExplicitLockMode =", btrievePython.Btrieve_LockModeToString(rc))
291
292
293
294rc = btrieveFileInformation.GetLockOwnerFileLock()
295assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerFileLock():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
296
297print("LockOwnerFileLock =", "Yes" if rc > 0 else "No")
298
299
300
301rc = btrieveFileInformation.GetLockOwnerImplicitLock()
302assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerImplicitLock():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
303
304print("LockOwnerImplicitLock =", "Yes" if rc > 0 else "No")
305
306
307
308rc = btrieveFileInformation.GetLockOwnerIndex()
309assert(rc != btrievePython.Btrieve.INDEX_UNKNOWN), "Error: BtrieveFileInformation::GetLockOwnerIndex():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
310
311print("LockOwnerIndex =", btrievePython.Btrieve_IndexToString(rc))
312
313
314
315rc = btrieveFileInformation.GetLockOwnerName()
316assert(rc != None), "Error: BtrieveFileInformation::GetLockOwnerName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
317
318print("LockOwnerName =", rc)
319
320
321
322rc = btrieveFileInformation.GetLockOwnerPageLockType()
323assert(rc != btrievePython.Btrieve.PAGE_LOCK_TYPE_UNKNOWN), "Error: BtrieveFileInformation::GetLockOwnerPageLockType():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
324
325print("LockOwnerPageLockType =", btrievePython.Btrieve_PageLockTypeToString(rc))
326
327
328
329rc = btrieveFileInformation.GetLockOwnerRecordLock()
330assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerRecordLock():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
331
332print("LockOwnerRecordLock =", "Yes" if rc > 0 else "No")
333
334
335
336rc = btrieveFileInformation.GetLockOwnerSameProcess()
337assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerSameProcess():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
338
339print("LockOwnerSameProcess =", "Yes" if rc > 0 else "No")
340
341
342
343rc = btrieveFileInformation.GetLockOwnerServiceAgentIdentifier()
344assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerServiceAgentIdentifier():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
345
346print("LockOwnerServiceAgentIdentifier =", rc)
347
348
349
350rc = btrieveFileInformation.GetLockOwnerTimeInTransaction()
351assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerTimeInTransaction():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
352
353print("LockOwnerTimeInTransaction =", rc)
354
355
356
357rc = btrieveFileInformation.GetLockOwnerTransactionLevel()
358assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerTransactionLevel():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
359
360print("LockOwnerTransactionLevel =", rc)
361
362
363
364rc = btrieveFileInformation.GetLockOwnerWriteHold()
365assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerWriteHold():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
366
367print("LockOwnerWriteHold =", "Yes" if rc > 0 else "No")
368
369
370
371rc = btrieveFileInformation.GetLockOwnerWriteNoWait()
372assert(rc >= 0), "Error: BtrieveFileInformation::GetLockOwnerWriteNoWait():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
373
374print("LockOwnerWriteNoWait =", "Yes" if rc > 0 else "No")
375
376
377
378rc = btrieveFileInformation.GetLoggable()
379assert(rc >= 0), "Error: BtrieveFileInformation::GetLoggable():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
380
381print("Loggable =", "Yes" if rc > 0 else "No")
382
383
384
385rc = btrieveFileInformation.GetLogIndex()
386assert(rc != btrievePython.Btrieve.INDEX_UNKNOWN), "Error: BtrieveFileInformation::GetLogIndex():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
387
388print("LogIndex =", btrievePython.Btrieve_IndexToString(rc))
389
390
391
392rc = btrieveFileInformation.GetOpenTimestamp()
393assert(rc >= 0), "Error: BtrieveFileInformation::GetOpenTimestamp():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
394
395print("OpenTimestamp =", rc)
396
397
398
399rc = btrieveFileInformation.GetOwnerMode()
400assert(rc != btrievePython.Btrieve.OWNER_MODE_UNKNOWN), "Error: BtrieveFileInformation::GetOwnerMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
401
402print("OwnerMode =", btrievePython.Btrieve_OwnerModeToString(rc))
403
404
405
406rc = btrieveFileInformation.GetPageCompression()
407assert(rc >= 0), "Error: BtrieveFileInformation::GetPageCompression():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
408
409print("PageCompression =", "Yes" if rc > 0 else "No")
410
411
412
413rc = btrieveFileInformation.GetPagePreallocation()
414assert(rc >= 0), "Error: BtrieveFileInformation::GetPagePreallocation():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
415
416print("PagePreallocation =", "Yes" if rc > 0 else "No")
417
418
419
420rc = btrieveFileInformation.GetPageSize()
421assert(rc != btrievePython.Btrieve.PAGE_SIZE_UNKNOWN), "Error: BtrieveFileInformation::GetPageSize():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
422
423print("PageSize =", btrievePython.Btrieve_PageSizeToString(rc))
424
425
426
427rc = btrieveFileInformation.GetReadOnly()
428assert(rc >= 0), "Error: BtrieveFileInformation::GetReadOnly():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
429
430print("ReadOnly =", "Yes" if rc > 0 else "No")
431
432
433
434rc = btrieveFileInformation.GetRecordCompressionMode()
435assert(rc != btrievePython.Btrieve.RECORD_COMPRESSION_MODE_UNKNOWN), "Error: BtrieveFileInformation::GetRecordCompressionMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
436
437print("RecordCompressionMode =", btrievePython.Btrieve_RecordCompressionModeToString(rc))
438
439
440
441rc = btrieveFileInformation.GetRecordCount()
442assert(rc >= 0), "Error: BtrieveFileInformation::GetRecordCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
443
444print("RecordCount =", rc)
445
446
447
448rc = btrieveFileInformation.GetReferentialIntegrityConstraints()
449assert(rc >= 0), "Error: BtrieveFileInformation::GetReferentialIntegrityConstraints():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
450
451print("ReferentialIntegrityConstraints =", "Yes" if rc > 0 else "No")
452
453
454
455rc = btrieveFileInformation.GetReferentialIntegrityCursorPosition()
456assert(rc >= 0), "Error: BtrieveFileInformation::GetReferentialIntegrityCursorPosition():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
457
458print("ReferentialIntegrityCursorPosition =", rc)
459
460
461
462rc = btrieveFileInformation.GetReferentialIntegrityFileName()
463assert(rc != None), "Error: BtrieveFileInformation::GetReferentialIntegrityFileName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
464
465print("ReferentialIntegrityFileName =", rc)
466
467
468
469rc = btrieveFileInformation.GetReferentialIntegrityOperationCode()
470assert(rc >= 0), "Error: BtrieveFileInformation::GetReferentialIntegrityOperationCode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
471
472print("ReferentialIntegrityOperationCode =", rc)
473
474
475
476rc = btrieveFileInformation.GetSecurityCurrentDatabaseAuthenticationByDatabase()
477assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseAuthenticationByDatabase():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
478
479print("SecurityCurrentDatabaseAuthenticationByDatabase =", "Yes" if rc > 0 else "No")
480
481
482
483rc = btrieveFileInformation.GetSecurityCurrentDatabaseAuthorizationByDatabase()
484assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseAuthorizationByDatabase():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
485
486print("SecurityCurrentDatabaseAuthorizationByDatabase =", "Yes" if rc > 0 else "No")
487
488
489
490rc = btrieveFileInformation.GetSecurityCurrentDatabaseBtpasswd()
491assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseBtpasswd():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
492
493print("SecurityCurrentDatabaseBtpasswd =", "Yes" if rc > 0 else "No")
494
495
496
497rc = btrieveFileInformation.GetSecurityCurrentDatabaseExplicit()
498assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseExplicit():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
499
500print("SecurityCurrentDatabaseExplicit =", "Yes" if rc > 0 else "No")
501
502
503
504rc = btrieveFileInformation.GetSecurityCurrentDatabaseImplicit()
505assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseImplicit():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
506
507print("SecurityCurrentDatabaseImplicit =", "Yes" if rc > 0 else "No")
508
509
510
511rc = btrieveFileInformation.GetSecurityCurrentDatabaseName()
512assert(rc != None), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
513
514print("SecurityCurrentDatabaseName =", rc)
515
516
517
518rc = btrieveFileInformation.GetSecurityCurrentDatabasePAM()
519assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabasePAM():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
520
521print("SecurityCurrentDatabasePAM =", "Yes" if rc > 0 else "No")
522
523
524
525rc = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSComplete()
526assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSComplete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
527
528print("SecurityCurrentDatabaseRTSSComplete =", "Yes" if rc > 0 else "No")
529
530
531
532rc = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSDisabled()
533assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSDisabled():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
534
535print("SecurityCurrentDatabaseRTSSDisabled =", "Yes" if rc > 0 else "No")
536
537
538
539rc = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSPreauthorized()
540assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSPreauthorized():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
541
542print("SecurityCurrentDatabaseRTSSPreauthorized =", "Yes" if rc > 0 else "No")
543
544
545
546rc = btrieveFileInformation.GetSecurityCurrentDatabaseTrusted()
547assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseTrusted():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
548
549print("SecurityCurrentDatabaseTrusted =", "Yes" if rc > 0 else "No")
550
551
552
553rc = btrieveFileInformation.GetSecurityCurrentDatabaseWindowsNamedPipe()
554assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseWindowsNamedPipe():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
555
556print("SecurityCurrentDatabaseWindowsNamedPipe =", "Yes" if rc > 0 else "No")
557
558
559
560rc = btrieveFileInformation.GetSecurityCurrentDatabaseWorkgroup()
561assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityCurrentDatabaseWorkgroup():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
562
563print("SecurityCurrentDatabaseWorkgroup =", "Yes" if rc > 0 else "No")
564
565
566
567rc = btrieveFileInformation.GetSecurityCurrentUserName()
568assert(rc != None), "Error: BtrieveFileInformation::GetSecurityCurrentUserName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
569
570print("SecurityCurrentUserName =", rc)
571
572
573
574rc = btrieveFileInformation.GetSecurityHandleAuthenticationByDatabase()
575assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleAuthenticationByDatabase():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
576
577print("SecurityHandleAuthenticationByDatabase =", "Yes" if rc > 0 else "No")
578
579
580
581rc = btrieveFileInformation.GetSecurityHandleAuthorizationByDatabase()
582assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleAuthorizationByDatabase():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
583
584print("SecurityHandleAuthorizationByDatabase =", "Yes" if rc > 0 else "No")
585
586
587
588rc = btrieveFileInformation.GetSecurityHandleBtpasswd()
589assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleBtpasswd():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
590
591print("SecurityHandleBtpasswd =", "Yes" if rc > 0 else "No")
592
593
594
595rc = btrieveFileInformation.GetSecurityHandleDatabaseName()
596assert(rc != None), "Error: BtrieveFileInformation::GetSecurityHandleDatabaseName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
597
598print("SecurityHandleDatabaseName =", rc)
599
600
601
602rc = btrieveFileInformation.GetSecurityHandleExplicit()
603assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleExplicit():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
604
605print("SecurityHandleExplicit =", "Yes" if rc > 0 else "No")
606
607
608
609rc = btrieveFileInformation.GetSecurityHandleImplicit()
610assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleImplicit():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
611
612print("SecurityHandleImplicit =", "Yes" if rc > 0 else "No")
613
614
615
616rc = btrieveFileInformation.GetSecurityHandlePAM()
617assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandlePAM():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
618
619print("SecurityHandlePAM =", "Yes" if rc > 0 else "No")
620
621
622
623rc = btrieveFileInformation.GetSecurityHandleRTSSComplete()
624assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleRTSSComplete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
625
626print("SecurityHandleRTSSComplete =", "Yes" if rc > 0 else "No")
627
628
629
630rc = btrieveFileInformation.GetSecurityHandleRTSSDisabled()
631assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleRTSSDisabled():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
632
633print("SecurityHandleRTSSDisabled =", "Yes" if rc > 0 else "No")
634
635
636
637rc = btrieveFileInformation.GetSecurityHandleRTSSPreauthorized()
638assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleRTSSPreauthorized():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
639
640print("SecurityHandleRTSSPreauthorized =", "Yes" if rc > 0 else "No")
641
642
643
644rc = btrieveFileInformation.GetSecurityHandleTableName()
645assert(rc != None), "Error: BtrieveFileInformation::GetSecurityHandleTableName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
646
647print("SecurityHandleTableName =", rc)
648
649
650
651rc = btrieveFileInformation.GetSecurityHandleTrusted()
652assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleTrusted():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
653
654print("SecurityHandleTrusted =", "Yes" if rc > 0 else "No")
655
656
657
658rc = btrieveFileInformation.GetSecurityHandleUserName()
659assert(rc != None), "Error: BtrieveFileInformation::GetSecurityHandleUserName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
660
661print("SecurityHandleUserName =", rc)
662
663
664
665rc = btrieveFileInformation.GetSecurityHandleWindowsNamedPipe()
666assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleWindowsNamedPipe():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
667
668print("SecurityHandleWindowsNamedPipe =", "Yes" if rc > 0 else "No")
669
670
671
672rc = btrieveFileInformation.GetSecurityHandleWorkgroup()
673assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityHandleWorkgroup():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
674
675print("SecurityHandleWorkgroup =", "Yes" if rc > 0 else "No")
676
677
678
679rc = btrieveFileInformation.GetSecurityPermissionAlter()
680assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionAlter():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
681
682print("SecurityPermissionAlter =", "Yes" if rc > 0 else "No")
683
684
685
686rc = btrieveFileInformation.GetSecurityPermissionCreateFile()
687assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionCreateFile():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
688
689print("SecurityPermissionCreateFile =", "Yes" if rc > 0 else "No")
690
691
692
693rc = btrieveFileInformation.GetSecurityPermissionCreateStoredProcedure()
694assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionCreateStoredProcedure():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
695
696print("SecurityPermissionCreateStoredProcedure =", "Yes" if rc > 0 else "No")
697
698
699
700rc = btrieveFileInformation.GetSecurityPermissionCreateView()
701assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionCreateView():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
702
703print("SecurityPermissionCreateView =", "Yes" if rc > 0 else "No")
704
705
706
707rc = btrieveFileInformation.GetSecurityPermissionDelete()
708assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionDelete():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
709
710print("SecurityPermissionDelete =", "Yes" if rc > 0 else "No")
711
712
713
714rc = btrieveFileInformation.GetSecurityPermissionExecute()
715assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionExecute():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
716
717print("SecurityPermissionExecute =", "Yes" if rc > 0 else "No")
718
719
720
721rc = btrieveFileInformation.GetSecurityPermissionCreateRecord()
722assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionCreateRecord():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
723
724print("SecurityPermissionCreateRecord =", "Yes" if rc > 0 else "No")
725
726
727
728rc = btrieveFileInformation.GetSecurityPermissionNoRights()
729assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionNoRights():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
730
731print("SecurityPermissionNoRights =", "Yes" if rc > 0 else "No")
732
733
734
735rc = btrieveFileInformation.GetSecurityPermissionOpen()
736assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionOpen():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
737
738print("SecurityPermissionOpen =", "Yes" if rc > 0 else "No")
739
740
741
742rc = btrieveFileInformation.GetSecurityPermissionRead()
743assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionRead():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
744
745print("SecurityPermissionRead =", "Yes" if rc > 0 else "No")
746
747
748
749rc = btrieveFileInformation.GetSecurityPermissionRefer()
750assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionRefer():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
751
752print("SecurityPermissionRefer =", "Yes" if rc > 0 else "No")
753
754
755
756rc = btrieveFileInformation.GetSecurityPermissionUpdate()
757assert(rc >= 0), "Error: BtrieveFileInformation::GetSecurityPermissionUpdate():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
758
759print("SecurityPermissionUpdate =", "Yes" if rc > 0 else "No")
760
761
762
763rc = btrieveFileInformation.GetSegmented()
764assert(rc >= 0), "Error: BtrieveFileInformation::GetSegmented():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
765
766print("Segmented =", "Yes" if rc > 0 else "No")
767
768
769
770rc = btrieveFileInformation.GetSegmentCount()
771assert(rc >= 0), "Error: BtrieveFileInformation::GetSegmentCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
772
773print("SegmentCount =", rc)
774
775
776segmentCount = rc
777
778for i in range(1, segmentCount + 1):
779
780 rc = btrieveFileInformation.GetSegmentFileName(i)
781 assert(rc != None), "Error: BtrieveFileInformation::GetSegmentFileName():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
782
783 print("SegmentFileName =", rc)
784
785
786
787rc = btrieveFileInformation.GetSystemDataMode()
788assert(rc != btrievePython.Btrieve.SYSTEM_DATA_MODE_UNKNOWN), "Error: BtrieveFileInformation::GetSystemDataMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
789
790print("SystemDataMode =", btrievePython.Btrieve_SystemDataModeToString(rc))
791
792
793
794rc = btrieveFileInformation.GetSystemData()
795assert(rc >= 0), "Error: BtrieveFileInformation::GetSystemData():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
796
797print("SystemIndexPresent =", "Yes" if rc > 0 else "No")
798
799
800
801rc = btrieveFileInformation.GetSystemIndexSize()
802assert(rc >= 0), "Error: BtrieveFileInformation::GetSystemIndexSize():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
803
804print("SystemIndexSize =", rc)
805
806
807
808rc = btrieveFileInformation.GetSystemIndex()
809assert(rc >= 0), "Error: BtrieveFileInformation::GetSystemIndex():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
810
811print("SystemIndexUsed =", "Yes" if rc > 0 else "No")
812
813
814
815rc = btrieveFileInformation.GetSystemIndexVersion()
816assert(rc >= 0), "Error: BtrieveFileInformation::GetSystemIndexVersion():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
817
818print("SystemIndexVersion =", rc)
819
820
821
822rc = btrieveFileInformation.GetUnusedDuplicatePointerCount()
823assert(rc >= 0), "Error: BtrieveFileInformation::GetUnusedDuplicatePointerCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
824
825print("UnusedDuplicatePointerCount =", rc)
826
827
828
829rc = btrieveFileInformation.GetUnusedPageCount()
830assert(rc >= 0), "Error: BtrieveFileInformation::GetUnusedPageCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
831
832print("UnusedPageCount =", rc)
833
834
835
836rc = btrieveFileInformation.GetUsageCount()
837assert(rc >= 0), "Error: BtrieveFileInformation::GetUsageCount():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
838
839print("UsageCount =", rc)
840
841
842
843rc = btrieveFileInformation.GetVariableLengthRecordsMode()
844assert(rc != btrievePython.Btrieve.VARIABLE_LENGTH_RECORDS_MODE_UNKNOWN), "Error: BtrieveFileInformation::GetVariableLengthRecordsMode():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
845
846print("VariableLengthRecordsMode =", btrievePython.Btrieve_VariableLengthRecordsModeToString(rc))
847
848
849
850rc = btrieveFileInformation.GetWrongOwner()
851assert(rc >= 0), "Error: BtrieveFileInformation::GetWrongOwner():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(btrieveFileInformation.GetLastStatusCode()))
852
853print("WrongOwner =", "Yes" if rc > 0 else "No")
854
855
856# Close file.
857rc = btrieveClient.FileClose(btrieveFile)
858assert(rc == btrievePython.Btrieve.STATUS_CODE_NO_ERROR), "Error: BtrieveClient::FileClose():%d:%s.\n" % (rc, btrievePython.Btrieve_StatusCodeToString(rc))