inodeMimeType

Get mime type for stat mode.

This function is Posix only.

  1. string inodeMimeType(mode_t mode)
    version(Posix)
    @trusted nothrow
    string
    inodeMimeType
    (
    mode_t mode
    )
  2. string inodeMimeType(const(char)[] filePath)

Return Value

Type: string

inode/* mime type name for mode or null if unknown. Regular files don't have inode/* type.

Examples

assert(inodeMimeType(S_IFCHR) == "inode/chardevice");
assert(inodeMimeType(S_IFBLK) == "inode/blockdevice");
assert(inodeMimeType(S_IFIFO) == "inode/fifo");
assert(inodeMimeType(S_IFSOCK) == "inode/socket");

Meta