Class | Ferret::Store::Directory |
In: |
ext/r_store.c
|
Parent: | Object |
A Directory is an object which is used to access the index storage. Ruby‘s IO API is not used so that we can use different storage mechanisms to store the index. Some examples are;
NOTE: Once a file has been written and closed, it can no longer be modified. To make any changes to the file it must be deleted and rewritten. For this reason, the method to open a file for writing is called create_output, while the method to open a file for reading is called open_input If there is a risk of simultaneous modifications of the files then locks should be used. See Lock to find out how.
LOCK_PREFIX | = | rb_str_new2(LOCK_PREFIX) |
It is a good idea to close a directory when you have finished using it. Although the garbage collector will currently handle this for you, this behaviour may change in future.
Make a lock with the name lock_name. Note that lockfiles will be stored in the directory with other files but they won‘t be visible to you. You should avoid using files with a .lck extension as this extension is reserved for lock files