libFAR

A simple File ARchiving library
This little library archives directory contents preserving permission,
owner/group, file type, creation/modification date-time and all the information
you can find in a stat structure. The integrity of every regular file entry is protected
by an MD5 digest, there's also a MD5 digest for the whole archive.

Below you can see the structure of a FAR archive:

And this is the "File info structure":
#if (defined(_sun) || defined(__sun__))
typedef uint64_t        u_int64_t;
#endif

struct far_stat
{
        unsigned        int     fst_uid,
                                fst_gid;
        unsigned        int     fst_mode;
        unsigned        int     __pad;
        u_int64_t               fst_atime,
                                fst_mtime;
        u_int64_t               fst_rdev;
        u_int64_t               fst_size;
};

typedef struct _far_info_
{
        struct  _far_info_      *next,
                                *prev;
        char                    path[1024],
                                link_path[1024];
        struct  far_stat        entry_info;
        unsigned        char    chksum[16];
        size_t                  offset;
        int                     __pad;
} FAR_INFO;

I'm working on libfar v4, that will features littler archives, archiving/unarchiving to/from filedescriptors, socketdescriptors, buffers. I had not so much time to work on it so the development is in delay, but in at max a month I will release an alpha version of the library.

- Disclaimer
- libFAR doesn't compile on FreeBSD using its make.
- It's not possible to use a parameter like "dir1/dir2/" as fname for far_file(), but passing simlply the name of the first dir of the path you can extract the whole dir.

- Download
first stable release; this version DOES NOT PRESERVE backward compatibility

v4.0.0-alpha - first release of the 4 major version
Changes:
  1. New archiving format
  2. Faster single entry's extraction trhough the use of an hashing algorithm
  3. read from/write to buffers, filedescriptors and socketdescriptors

* Older releases

v1.13.8-alpha - first release
v1.15.10-alpha - standardized byte ordering
v1.16.11-alpha - added an md5 digest for the whole archive
v1.18.11-alpha - the BSD function scandir has been reimplemented
v1.19.12-alpha - fixed the struct dirent handling on Sun Solaris, both archiving and unarchiving now work well, but Linux archives are still unportable to Solaris
v2.21.13-alpha - struct stat in FAR_INFO has been replaced by struct far_stat for portability purpose and Linux's archives are finally portable to Sun Solaris (and viceversa). This version doesn't preserve backward compatibility
v2.21.14-alpha - added the function far_file() to extract a single file
v2.21.16-beta - now far_file() can extract complete directories (complete of their content)


[SCAIN]  [KBDLOCK] [PHP LDBI+SQLi] [De.Ser.T. Consulting]



This site supports the OpenDVD project
OpenDVD