普通网友 2023-10-27 17:25 采纳率: 18.2%
浏览 10

libburn库的使用


/** Scan for drives. This function MUST be called until it returns nonzero.
    In case of re-scanning:
    All pointers to struct burn_drive and all struct burn_drive_info arrays
    are invalidated by using this function. Do NOT store drive pointers across
    calls to this function !
    To avoid invalid pointers one MUST free all burn_drive_info arrays
    by burn_drive_info_free() before calling burn_drive_scan() a second time.
    If there are drives left, then burn_drive_scan() will refuse to work.

    After this call all drives depicted by the returned array are subject
    to eventual (O_EXCL) locking. See burn_preset_device_open(). This state
    ends either with burn_drive_info_forget() or with burn_drive_release().
    It is unfriendly to other processes on the system to hold drives locked
    which one does not definitely plan to use soon.
    @param drive_infos Returns an array of drive info items (cdroms/burners).
                  The returned array must be freed by burn_drive_info_free()
                  before burn_finish(), and also before calling this function
                  burn_drive_scan() again.
    @param n_drives Returns the number of drive items in drive_infos.
    @return 0 while scanning is not complete
            >0 when it is finished successfully,
            <0 when finished but failed.
*/
int burn_drive_scan(struct burn_drive_info *drive_infos[],
            unsigned int *n_drives);

博主我用这个函数为甚麽会一直返回0呢

  • 写回答

2条回答 默认 最新

  • K_n_i_g_h_t_1990 2023-10-27 17:38
    关注

    发现您可能没有正确地使用burn_drive_scan函数。这个函数的作用是扫描可用的光驱,并返回一个包含光驱信息的数组。这个函数需要在一个循环中调用,直到它返回非零值为止。如果您只调用一次这个函数,它可能会返回0,表示扫描还没有完成。

    评论

报告相同问题?

问题事件

  • 创建了问题 10月27日

悬赏问题

  • ¥15 SQL Server下载
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题
  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求