dir_s_alloc(VALUE klass)
{
    struct dir_data *dirp;
    VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp);

    dirp->dir = NULL;
    RB_OBJ_WRITE(obj, &dirp->path, Qnil);
    dirp->enc = NULL;

    return obj;
}
dir_s_alloc(VALUE klass)
{
    struct dir_data *dirp;
    VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp);

    dirp->dir = NULL;
    RB_OBJ_WRITE(obj, &dirp->path, Qnil);
    dirp->enc = NULL;

    return obj;
}