slow5curl

s5curl_idx_load

NAME

s5curl_idx_load - fetches and loads the index file for a remote BLOW5 file

SYNOPSYS

int s5curl_idx_load(s5curl_t *s5c)

DESCRIPTION

s5curl_idx_load() fetches and loads an index file for a remote BLOW5 file pointed by s5c to its URL and associates the index with s5c.

s5curl_idx_load() should be called successfully before using s5curl_get() or s5curl_get_batch().

RETURN VALUE

Upon successful completion, s5curl_idx_load() returns a non negative integer (>=0). Otherwise, a negative value is returned that indicates the error. If the error occured with SLOW5 then slow5_errno is set to indicate the error.

ERRORS

EXAMPLES

#include <slow5curl/s5curl.h>

#define URL "https://example.blow5"

int main () {

    // setup

    s5curl_t *s5c = s5curl_open(URL);

    ret = s5curl_idx_load(s5c);
    if (ret < 0) {
        fprintf(stderr, "Error in loading index\n");
        exit(EXIT_FAILURE);
    }

    // s5curl operations

    s5curl_idx_unload(s5c);

    s5curl_close(s5c);

    // cleanup
}

SEE ALSO

s5curl_idx_unload(), s5curl_idx_load_with()