logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

lc_syncfilelocal - synchronize two local files

Description

       The lc_syncfilelocal() function synchronizes the file at dst with the file at src by overwriting dst with
       bytes from src.  If dst does not exist, it is created.

       If  q  is  not  NULL, it must point to a queue q_t structure previously initialized with q_init(3).  This
       queue will have jobs enqueued to build the tree. This is normally used in conjunction with  a  threadpool
       created with q_pool_create(3) with threads all calling q_job_seek(3).

       If q is NULL, the creation and destruction of a queue and threadpool will be handled automatically.

       If stats is not NULL, transfer statistics will be returned in this structure.

       opt is not used, at present, and must be NULL for compatibility with future versions.

       The flags argument is the bitwise OR of zero of more of the following flags:

       MDEX_RECURSE
              recursively index directories.

Errors

EINVAL Invalid argument.

       ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001).

       lc_syncfilelocal() can also fail with any of the errors for mmap(2) or chmod(2).

Library

       Librecast library (liblibrecast, -llibrecast)

Name

       lc_syncfilelocal - synchronize two local files

Return Value

       The  lc_syncfilelocal() function returns zero on success, or -1 if an error occurred.  In the event of an
       error, errno is set to indicate the error.

See Also

lc_memsync(3), lc_sync(3), lc_syncfile(3),  q_init(3),  q_free(3),  q_pool_create(3),  q_pool_destroy(3),
       q_job_seek(3), chmod(2), mmap(2)

LIBRECAST                                          2023-08-22                                LC_SYNCFILELOCAL(3)

Synopsis

#include<librecast/sync.h>intlc_syncfilelocal(constchar*dst,constchar*src,q_t*qlc_stat_t*stats,lc_sync_options_t*opt,intflags);

       Compile and link with -llibrecast.

See Also