Alien-Libjio
view release on metacpan or search on metacpan
libjio/UPGRADING view on Meta::CPAN
------- 1.00: Stable release
-> 0.90 (On-disk format change, pre 1.0 freeze)
- The way transactions are stored on disk has changed. It is mandatory that
you jfsck all your files before upgrading. Hopefully this will be the last
backwards-incompatible format change before 1.0.
- jtrans_new() now takes an additional flags parameter.
- jopen() jflags parameter is now unsigned.
- J_NOCLEANUP was removed in favour of J_CLEANUP, and the default behaviour
of jfsck() is now not to clean up unless J_CLEANUP is passed in the flags.
- jtrans_add() renamed to jtrans_add_w().
- jtrans_commit() returns 0 on success, instead of the amount of bytes
written.
-> 0.50 (Big API change)
- Structures are now opaque types:
struct jfs -> jfs_t; jopen() returns a pointer to one, jclose() frees it.
struct jtrans -> jtrans_t; jtrans_new() returns a pointer to one,
jtrans_free() frees it.
- Renamed jtrans_init() to jtrans_new().
- jtrans_commit() returns -1 on recovered errors, -2 on unrecovered errors
libjio/UPGRADING view on Meta::CPAN
- Applications need to be recompiled due to a change in the jfs structure.
-> 0.20
- Applications need to be recompiled due to a change in the jfs structure.
- When you link your applications with libjio, you need to make sure you
compile using large file support.
-> 0.19
- Applications need to be recompiled due to a change in the flag numbering.
- A flag number has changed, from J_COMMITED to J_COMMITTED. If you used
that flag, you need to rename it.
libjio/doc/libjio.rst view on Meta::CPAN
If you want, and are careful enough, you can safely use the library and still
do I/O using the regular UNIX calls.
This section provides some general guidelines that you need to follow in order
to prevent corruption. Of course you can bend or break them according to your
use, this is just a general overview on how to interact from outside.
- Lock the sections you want to use: the library, as we have already exposed,
relies on fcntl() locking; so, if you intend to operate on parts on the
file while using it, you should lock them.
- Don't truncate, unlink or rename: these operations have serious
implications when they're done while using the library, because the library
itself assumes that names don't change, and files don't disappear from
underneath it. It could potentially lead to corruption, although most of
the time you would just get errors from every call.
libjio/libjio/trans.c view on Meta::CPAN
jsync(fs);
oldpath = fs->jdir;
snprintf(oldjlockfile, PATH_MAX, "%s/lock", fs->jdir);
fs->jdir = (char *) malloc(strlen(newpath) + 1);
if (fs->jdir == NULL)
return -1;
strcpy(fs->jdir, newpath);
ret = rename(oldpath, newpath);
if (ret == -1 && (errno == ENOTEMPTY || errno == EEXIST) ) {
/* rename() failed, the dest. directory is not empty, so we
* have to reload everything */
close(fs->jdirfd);
fs->jdirfd = open(newpath, O_RDONLY);
if (fs->jdirfd < 0)
goto exit;
snprintf(jlockfile, PATH_MAX, "%s/lock", newpath);
ret = rename(oldjlockfile, jlockfile);
if (ret < 0)
goto exit;
/* remove the journal directory, if possible */
unlink(oldjlockfile);
ret = rmdir(oldpath);
if (ret == -1) {
/* we couldn't remove it, something went wrong
* (possibly it had some files left) */
goto exit;
( run in 0.697 second using v1.01-cache-2.11-cpan-e9daa2b36ef )