KDK_GET_DISKLISK(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

✨ KDK_GET_DISKLISK ✨

okay bestie, so this is a page from the Library Functions Manual, it's kdk_get_disklist(3), and it's literally the girliest way to go find out what disks you have 💅 no cap.


🎀 NAME 🎀

kdk_get_disklist — 获取磁盘列表信息 (aka: get that disk list info, periodt)


🌸 SYNOPSIS 🌸

#include <libkydiskinfo.h>

extern char** kdk_get_disklist();

Link with -lkydiskinfo.


🦋 Detailed Description 🦋

So the kdk_get_disklist() function obtains disk list information during the call process. That's the whole vibe — you call it, it goes and gets you the disk list. main character energy fr fr 💖


💜 RETURN VALUE 💜

The return value is a char** type, and bestie, each string in there is the absolute path of a disk, and the whole thing ends with a NULL character. Like, that NULL is the little "we're done here" signal, iykyk.

After you're done with it, the kdk_free_disklist() function releases that list of disk information. Do NOT skip this, okay? Free your memory, queen 👑


⭐ EXAMPLES ⭐

#include "libkydiskinfo.h"
#include <stdio.h>

int main()
{
    char **disklist = kdk_get_disklist();
    for (int i = 0; disklist[i]; i ++)
    {
        printf("%s0, disklist[i]);
    }

    kdk_free_disklist(disklist);

    return 0;
}

🌈 CONFORMING TO 🌈

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_get_diskinfo(), kdk_get_hard_disk(), and kdk_get_hard_disk_size().


👑 SEE ALSO 👑


aaaand that's the page 🫶 this lil beauty lives in the Linux Programmer's Manual, dated Thu Aug 10 2023, and yes the header at the top said KDK_GET_DISKLISK(3) because we stay consistent. byeeee, go free your disklist 💖✨

📦 where this page comes from