| Home | About FairCom | Products | Support | Sales | Contact Info | Site Map | Download | Newsletter |

Company Overview
History
Our Customers
Success Stories
Contact Information
Why FairCom
FairCom Logos
Press Releases
Customer Quotes
Site Map
Read the Dr. Dobb's Journal article on cross-platform database Programming
Read HP WORLD's article on the c-tree Server
Read the Linux Journal review on c-tree Plus
FairCom Brochure
 
 

Exclusive File Opens With c-treeDB

Are you still using ISAM or lowlevel c-tree Plus calls? While those may be appropriate for some implementations, consider jump starting your new development with c-treeDB! c-treeDB hides away all of the nitty-gritty facets of c-tree Plus programming, leading to shorter learning curves for developers. c-treeDB also puts you one step closer to complete c-treeSQL integration with your application. Not only is c-tree Plus fast, it is fast to put to use! Get your application to market faster. Join the majority of c-tree users who have already made the switch and are reaping the benefits.

c-treeDB provides a powerful database-centric view of your data. Offering programmatic API's in both C and C++, you can use it immediately out of the box. As this is still a new c-tree Plus development environment for many, questions frequently arise that are easy to address.

How can I access a file through the server on a CD?

With the c-treeDB API and the c-tree Server V8.14 it can seem you can't open a data file (*.dat) when the file is write-protected or the folder has read only permission. Consider the case of a database file residing on a CD or DVD. The following c-treeDB C++ API call may unexpectedly return error FNOP_ERR (12, file not found):

pTable->Open(TableName, CTOPEN_READONLY); 

Accessing these particular types of files requires more than just CTOPEN_READONLY. You also need exclusive access to the file. Therefore, open the file using the following file mode:

CTOPEN_READONLY|CTOPEN_EXCLUSIVE

and simply change your c-treeDB Open call to the following:

pTable->Open(TableName, CTOPEN_READONLY|CTOPEN_EXCLUSIVE);

By default, c-treeDB opens the file in shared mode. When opening a file in shared mode and CTOPEN_READONLY the c-tree Server tries to open the file at the O/S level in read and write mode, as there may be other users opening the file in write mode (that's what in c-tree shared+read-only means). In order to have read-only access to the file and at the same time avoid other user to access the file in write mode, you have to use read-only+exclusive. With this combination the c-tree Server opens the file at O/S level in read-only mode, as other users can write on it.

Note: In this case CTOPEN_EXCLUSIVE does not means that you have exclusive access to the file, but that this file can be opened only in read-only mode.


 
The speed comparisons between FoxPro/CodeBase and SQL databases such as DB2, Sybase, and MS SQL are misleading. The very nature of SQL databases is slow throughput. FairCom has a much faster and very reliable solution. We changed to FairCom because we needed a back end that could handle real world loads reliably, and we needed the flexibility to support different platforms. Since we made the change, our customer support calls are down 75%!

Ken Morris
President/CEO, M-Systems, Inc.

 
WEB COMMENTS
Copyright 2007 FairCom Corporation. All rights reserved.