FmDeepCountJob

## FmDeepCountJob FmDeepCountJob — Job to gather information about file sizes. |

## Synopsis

    #define             FM_DEEP_COUNT_JOB_TYPE
    struct              FmDeepCountJob;
    struct              FmDeepCountJobClass;
    enum                FmDeepCountJobFlags;
    FmDeepCountJob *    fm_deep_count_job_new               (FmPathList *paths,
                                                             FmDeepCountJobFlags flags);
    void                fm_deep_count_job_set_dest          (FmDeepCountJob *dc,
                                                             dev_t dev,
                                                             const char *fs_id);

## Object Hierarchy

      GObject
       +----FmJob
             +----FmDeepCountJob

## Description

`include`: libfm/fm.h

The FmDeepCountJob can be used to recursively gather information about some files and directories content before copy or move. It counts total size of all given files and directories, and size on disk for them. If flags for the job include FM_DC_JOB_PREPARE_MOVE then also count of files to move between volumes will be counted as well.

## Details

### FM_DEEP_COUNT_JOB_TYPE

    #define FM_DEEP_COUNT_JOB_TYPE              (fm_deep_count_job_get_type())

### struct FmDeepCountJob

    struct FmDeepCountJob {
        FmJob parent;
        FmPathList* paths;
        FmDeepCountJobFlags flags;
        goffset total_size;
        goffset total_ondisk_size;
        guint count;
    };

FmJob `parent`; | the parent object
FmPathList *`paths`; | list of paths to count
FmDeepCountJobFlags `flags`; | flags for counting
goffset `total_size`; | counted total file size
goffset `total_ondisk_size`; | counted total file size on disk
guint `count`; | number of files to be moved between devices

### struct FmDeepCountJobClass

    struct FmDeepCountJobClass {
    };

### enum FmDeepCountJobFlags

    typedef enum {
        FM_DC_JOB_DEFAULT = 0,
        FM_DC_JOB_FOLLOW_LINKS = 1<<0,
        FM_DC_JOB_SAME_FS = 1<<1,
        FM_DC_JOB_PREPARE_MOVE = 1<<2,
        FM_DC_JOB_PREPARE_DELETE = 1 <<3
    } FmDeepCountJobFlags;

`FM_DC_JOB_DEFAULT` | do deep count for all files/folders
`FM_DC_JOB_FOLLOW_LINKS` | don't follow symlinks
`FM_DC_JOB_SAME_FS` | only do deep count for files on the same devices. what's the use case of this?
`FM_DC_JOB_PREPARE_MOVE` | special handling for moving files. only do deep count for files on different devices
`FM_DC_JOB_PREPARE_DELETE` | special handling for deleting files

### fm_deep_count_job_new ()

    FmDeepCountJob *    fm_deep_count_job_new               (FmPathList *paths,
                                                             FmDeepCountJobFlags flags);

Creates a new FmDeepCountJob which can be ran via FmJob API.

`paths` : | list of files and directories to count sizes
`flags` : | flags of the counting behavior
Returns : | a new FmDeepCountJob object. [transfer full]

Since 0.1.0

### fm_deep_count_job_set_dest ()

    void                fm_deep_count_job_set_dest          (FmDeepCountJob *dc,
                                                             dev_t dev,
                                                             const char *fs_id);

Sets destination for the job `dc` that will be used when the job is ran with any of flags FM_DC_JOB_SAME_FS or FM_DC_JOB_PREPARE_MOVE. If `dev` is 0 (and `fs_id` is NULL) then destination device is non on native filesystem.

`dc` : | a job to set the destination
`dev` : | UNIX device ID
`fs_id` : | filesystem id in gio format. [allow-none]

Since 0.1.0