bkisofs Usage and Reference Manual
<<< Previous | Function Reference | Next >>>

# Reading

## `bk_open_image()`

``int `bk_open_image``(VolInfo* `volInfo`, const char* `filename`);`

This basically just opens the ISO file for reading. The parameter `filename` can have any string in it that would work with the C function `open()`, i.e. it can have a full or relative or no path plus the name of the file.

Call `bk_open_image()` after `bk_init_vol_info()` and before `bk_read_vol_info()`.

## `bk_read_vol_info()`

``int `bk_read_vol_info``(VolInfo* `volInfo`);`

This reads information about the ISO: things like the volume name, creation time and the types of directory trees available (ISO9660, Rockrdge, Joliet). Also some boot record information is read (complete boot record info is not guaranteed until after the directory tree is read).

Important to know is that `bk_estimate_iso_size()` will not work at this point, you must read the directory tree first.

## `bk_read_dir_tree()`

``int `bk_read_dir_tree``(VolInfo* `volInfo`, int `filenameType`, bool `keepPosixPermissions`, void(*`progressFunction`)(VolInfo*));`

This function reads a set of entire directory trees (all the directories and files) from the ISO. bk is capable of reading ISO9660, RockRidge, and Joliet filenames so you can ask to read any of those. You have to decide which one you want based on the available types in `VolInfo`.`filenameTypes`. I recommend that you choose RockRidge over Joliet and Joliet over ISO9660. To illustrate, here's an example:

        if(GBLvolInfo.filenameTypes & FNTYPE_ROCKRIDGE)
            rc = bk_read_dir_tree(&GBLvolInfo, FNTYPE_ROCKRIDGE, true, activityProgressUpdaterCbk);
        else if(GBLvolInfo.filenameTypes & FNTYPE_JOLIET)
            rc = bk_read_dir_tree(&GBLvolInfo, FNTYPE_JOLIET, false, activityProgressUpdaterCbk);
        else
            rc = bk_read_dir_tree(&GBLvolInfo, FNTYPE_9660, false, activityProgressUpdaterCbk);

`progressFunction` is a pointer to a function that takes a `VolInfo*` as a parameter and returns `void`. bk will call this function every 1 second or so. You can pass in NULL if you like but in that case control won't be returned to your code until `bk_add()` is finished doing what it has to do so you can't update a progress bar or cancel adding.

<<< Previous | Home | Next >>>
Function Reference | Up | Adding