fs_ftype_to_dtype(9)
π fs_ftype_to_dtype(9) β from the Kernel API Manual, bestie π«Ά
Okay so picture this: you're deep in the kernel, you've got an on-disk file type just sitting there being all FT_*, and you need a dirent type DT_* instead. That's literally this function. It's the translator of the filesystem world and it ate, no cap. β¨
πΈ NAME πΈ
fs_ftype_to_dtype β the glow-up where an fs on-disk file type becomes a dirent type. π
π SYNOPSIS π
unsigned char fs_ftype_to_dtype (unsigned int filetype );
π¦ ARGUMENTS π¦
filetypeβ the on-disk file type you want converted. That's the one. That's the input. π
β¨ DESCRIPTION β¨
So what does it do, you ask? Obsessed that you asked. π₯° This function converts the on-disk file type value (the FT_* girlies) into the directory entry type (the DT_* girlies). It's giving translator, it's giving middle management, it's giving "I speak both languages fluently". π
Basically FT_* in, DT_* out. Simple. Iconic. Periodt. π
π§ CONTEXT π§
Any context. Literally any. Call it from anywhere, she doesn't care, she's flexible like that. π
π₯ RETURN π₯
Here's the whole menu of what you might get back, and every single one is on the list, no skipping, we don't do that here π«Ά:
DT_UNKNOWNβ unknown type, the mystery era πDT_FIFOβ FIFODT_CHRβ character deviceDT_DIRβ directory πDT_BLKβ block deviceDT_REGβ regular fileDT_LNKβ symbolic link πDT_SOCKβ local-domain socket π§¦
β SEE ALSO β
Go be nosy, bestie, the whole friend group is right here:
- Kernel file
./fs/fs_dirent.cfs_umode_to_ftype(9),fs_umode_to_dtype(9)
π Real talk for a sec: keep theFT_*βDT_*mapping straight in your head, because that's the entire personality of this function and there is no plan B. iykyk.
That's the whole page, bestie! π Brought to you straight outta ./fs π and dated October 2026 π β go forth and convert those file types, you absolute main character. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms